-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
Description
Code: ------------------------------------------------------------- package main type MyInterface interface { } type My struct { a, b, c int } var my = &My{1,2,3} var myInterface MyInterface = my var origMy, ok = myInterface.(*My) func main() { } ------------------------------------------------------------- Compilation gives: ------------------------------------------------------------- [nsf @ waytogo]$ 8g test.go defn [9f9cbc0] . AS2DOTTYPE l(12) x(-1000000000) tc(1) . AS2DOTTYPE-list . . NAME-origMy G0 u(1) a(1) l(12) class(1) tc(1) *My . . NAME-ok G0 u(1) a(1) l(12) class(1) tc(1) bool . AS2DOTTYPE-rlist . . DOTTYPE2 l(12) x(-1000000000) tc(1) *My . . . NAME-myInterface G0 u(1) a(1) l(11) class(1) tc(1) MyInterface test.go:15: internal compiler error: init1: bad defn ------------------------------------------------------------- Compiler/machine spec: linux, 386, b761e0299e9b release/release.2010-07-01 Even if it's not a legal declaration, good error message is expected.