diff options
author | Anthony Martin <ality@pbrane.org> | 2013-08-19 11:53:34 +1000 |
---|---|---|
committer | Anthony Martin <ality@pbrane.org> | 2013-08-19 11:53:34 +1000 |
commit | 4ee13979d7c6235a71d84d88494f24a83e3a90e9 (patch) | |
tree | bfdae9cfd97c060831ff7e9f33bdb6f763cd063f /test/interface/explicit.go | |
parent | 88ac467de54195fc6b890a24a4e5c7d0295a0be1 (diff) | |
download | go-4ee13979d7c6235a71d84d88494f24a83e3a90e9.tar.gz |
cmd/gc: don't attempt to generate wrappers for blank interface methods
Fixes issue 5691.
R=golang-dev, bradfitz, daniel.morsing, rsc
CC=golang-dev
https://codereview.appspot.com/10255047
Committer: Rob Pike <r@golang.org>
Diffstat (limited to 'test/interface/explicit.go')
-rw-r--r-- | test/interface/explicit.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/interface/explicit.go b/test/interface/explicit.go index eb81156e0..36fa1a422 100644 --- a/test/interface/explicit.go +++ b/test/interface/explicit.go @@ -80,3 +80,22 @@ 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" + + +type B1 interface { + _() +} + +type B2 interface { + M() + _() +} + +type T2 struct{} + +func (t *T2) M() {} +func (t *T2) _() {} + +// Check that nothing satisfies an interface with blank methods. +var b1 B1 = &T2{} // ERROR "incompatible|missing _ method" +var b2 B2 = &T2{} // ERROR "incompatible|missing _ method" |