diff options
author | Russ Cox <rsc@golang.org> | 2015-05-19 16:49:47 -0400 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-06-04 02:31:38 +0000 |
commit | 73d109c509e4f8c1122187fa406aa0be4ff88608 (patch) | |
tree | 03b5c56fb85832899ed64fabdcb8b9cfe3cdb52a /test/complit1.go | |
parent | 03410f675808ad51fa1e1fd153fd3d182ebcb217 (diff) | |
download | go-73d109c509e4f8c1122187fa406aa0be4ff88608.tar.gz go-73d109c509e4f8c1122187fa406aa0be4ff88608.zip |
cmd/internal/gc: accept map literals with omitted key type
Fixes #10209.
Change-Id: I248434f9195c868befd1ed8a6000a9cac72d1df8
Reviewed-on: https://go-review.googlesource.com/10263
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'test/complit1.go')
-rw-r--r-- | test/complit1.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/complit1.go b/test/complit1.go index 521401d739..c7a2ac96e0 100644 --- a/test/complit1.go +++ b/test/complit1.go @@ -40,3 +40,17 @@ var ( _ = &T{i: 0, f: 0, s: "", next: {}} // ERROR "missing type in composite literal|omit types within composite literal" _ = &T{0, 0, "", {}} // ERROR "missing type in composite literal|omit types within composite literal" ) + +type M map[T]T + +var ( + _ = M{{i:1}: {i:2}} + _ = M{T{i:1}: {i:2}} + _ = M{{i:1}: T{i:2}} + _ = M{T{i:1}: T{i:2}} +) + +type S struct { s [1]*M1 } +type M1 map[S]int +var _ = M1{{s:[1]*M1{&M1{{}:1}}}:2} + |