Commit eb63c3fe authored by Ian Lance Taylor's avatar Ian Lance Taylor

Test that the compiler rejects map types which should not be

compatible.

R=rsc
CC=go-dev
http://go/go-review/1018001
parent c54cb4cb
// errchk $G $D/$F.go
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
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 v3 = S{ make(map[uint]int) } // ERROR "cannot|illegal|incompatible|wrong"
......@@ -201,3 +201,6 @@ throw: interface conversion
panic PC=xxx
== bugs/
=========== bugs/bug212.go
BUG: errchk: command succeeded unexpectedly
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