summaryrefslogtreecommitdiff
path: root/test/interface/explicit.go
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-02-14 13:23:51 +0100
committerOndřej Surý <ondrej@sury.org>2011-02-14 13:23:51 +0100
commit758ff64c69e34965f8af5b2d6ffd65e8d7ab2150 (patch)
tree6d6b34f8c678862fe9b56c945a7b63f68502c245 /test/interface/explicit.go
parent3e45412327a2654a77944249962b3652e6142299 (diff)
downloadgolang-upstream/2011-02-01.1.tar.gz
Imported Upstream version 2011-02-01.1upstream/2011-02-01.1
Diffstat (limited to 'test/interface/explicit.go')
-rw-r--r--test/interface/explicit.go20
1 files changed, 12 insertions, 8 deletions
diff --git a/test/interface/explicit.go b/test/interface/explicit.go
index b952f8fc8..b6a582fff 100644
--- a/test/interface/explicit.go
+++ b/test/interface/explicit.go
@@ -51,21 +51,25 @@ func main() {
t = T(e) // ERROR "need explicit|need type assertion|incompatible"
}
-type M interface { M() }
+type M interface {
+ M()
+}
+
var m M
-var _ = m.(int) // ERROR "impossible type assertion"
+var _ = m.(int) // ERROR "impossible type assertion"
type Int int
-func (Int) M(float) {}
-var _ = m.(Int) // ERROR "impossible type assertion"
+func (Int) M(float64) {}
+
+var _ = m.(Int) // ERROR "impossible type assertion"
var ii int
var jj Int
-var m1 M = ii // ERROR "incompatible|missing"
-var m2 M = jj // ERROR "incompatible|wrong type for M method"
+var m1 M = ii // ERROR "incompatible|missing"
+var m2 M = jj // ERROR "incompatible|wrong type for M method"
-var m3 = M(ii) // ERROR "invalid|missing"
-var m4 = M(jj) // ERROR "invalid|wrong type for M method"
+var m3 = M(ii) // ERROR "invalid|missing"
+var m4 = M(jj) // ERROR "invalid|wrong type for M method"