Commit 6358cac7 authored by Ian Lance Taylor's avatar Ian Lance Taylor

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
parent a8246510
......@@ -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"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment