diff options
Diffstat (limited to 'test/interface5.go')
| -rw-r--r-- | test/interface5.go | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/test/interface5.go b/test/interface5.go index 2e273dddd..86036a778 100644 --- a/test/interface5.go +++ b/test/interface5.go @@ -12,10 +12,21 @@ var t *T type I interface { M() } var i I +type I2 interface { M(); N(); } +var i2 I2; + +var e interface { }; + func main() { + e = t; // ok + t = e; // ERROR "need explicit" + // neither of these can work, // because i has an extra method // that t does not, so i cannot contain a t. - i = t; // ERROR "missing|incompatible" - t = i; // ERROR "missing|incompatible" + i = t; // ERROR "missing|incompatible|is not" + t = i; // ERROR "missing|incompatible|is not" + + i = i2; // ok + i2 = i; // ERROR "need explicit" } |
