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
This commit is contained in:
Ian Lance Taylor 2009-11-02 11:58:47 -08:00
Родитель a82465103f
Коммит 6358cac7d8
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -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"