From 04b08da9af0c450d645ab7389d1467308cfc2db8 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Mon, 4 Mar 2013 21:27:36 +0100 Subject: Imported Upstream version 1.1~hg20130304 --- test/initializerr.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/initializerr.go') diff --git a/test/initializerr.go b/test/initializerr.go index 48908c347..ca0541455 100644 --- a/test/initializerr.go +++ b/test/initializerr.go @@ -26,3 +26,15 @@ var a5 = []byte { x: 2 } // ERROR "index" var ok1 = S { } // should be ok var ok2 = T { S: ok1 } // should be ok + +// These keys can be computed at compile time but they are +// not constants as defined by the spec, so they do not trigger +// compile-time errors about duplicate key values. +// See issue 4555. + +type Key struct {X, Y int} + +var _ = map[Key]string{ + Key{1,2}: "hello", + Key{1,2}: "world", +} -- cgit v1.2.3