зеркало из https://github.com/CryptoPro/go.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
This commit is contained in:
Родитель
a82465103f
Коммит
6358cac7d8
|
@ -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"
|
||||
|
|
Загрузка…
Ссылка в новой задаче