From: Ian Lance Taylor Date: Mon, 2 Nov 2009 19:58:47 +0000 (-0800) Subject: We should not silently permit a named type to match an unnamed X-Git-Tag: weekly.2009-11-06~131 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=6358cac7d85544d77ca27597bc4a46c61d0d964e;p=gostls13.git We should not silently permit a named type to match an unnamed type. This is OK in a conversion but not in an assignment. R=rsc http://go/go-review/1016024 --- diff --git a/test/bugs/bug212.go b/test/bugs/bug212.go index fcf5c4775f..079bb5791f 100644 --- a/test/bugs/bug212.go +++ b/test/bugs/bug212.go @@ -7,6 +7,6 @@ package main type I int type S struct { f map[I]int } -var v1 = S{ make(map[int]int) } // OK--names are ignored. -var v2 map[I]int = map[int]int{} // OK. +var v1 = S{ make(map[int]int) } // ERROR "cannot|illegal|incompatible|wrong" +var v2 map[I]int = map[int]int{} // ERROR "cannot|illegal|incompatible|wrong" var v3 = S{ make(map[uint]int) } // ERROR "cannot|illegal|incompatible|wrong"