aboutsummaryrefslogtreecommitdiff
path: root/test/alias.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2011-10-26 15:27:47 -0700
committerRuss Cox <rsc@golang.org>2011-10-26 15:27:47 -0700
commit8658b36ba2cab730e1717d61a88f72d92b27a286 (patch)
treecd57f88b3ac285f33654ec8959914d9ba6bb43ba /test/alias.go
parent0d8fb375edfa0840b4b44bce6f39cfe52011c402 (diff)
downloadgo-8658b36ba2cab730e1717d61a88f72d92b27a286.tar.gz
go-8658b36ba2cab730e1717d61a88f72d92b27a286.zip
test/alias.go: additional tests
R=ken2 CC=golang-dev https://golang.org/cl/5327045
Diffstat (limited to 'test/alias.go')
-rw-r--r--test/alias.go18
1 files changed, 17 insertions, 1 deletions
diff --git a/test/alias.go b/test/alias.go
index 6039b3183f..199c782d00 100644
--- a/test/alias.go
+++ b/test/alias.go
@@ -9,11 +9,27 @@ package main
// Test that error messages say what the source file says
// (uint8 vs byte).
+import (
+ "fmt"
+ "utf8"
+)
+
func f(byte) {}
func g(uint8) {}
func main() {
- var x int
+ var x float64
f(x) // ERROR "byte"
g(x) // ERROR "uint8"
+
+ // Test across imports.
+
+ var ff fmt.Formatter
+ var fs fmt.State
+ ff.Format(fs, x) // ERROR "rune"
+
+ utf8.RuneStart(x) // ERROR "byte"
+
+ var s utf8.String
+ s.At(x) // ERROR "int"
}