Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
94430937
Commit
94430937
authored
Dec 17, 2012
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: add "duplicate" struct map key test
Update #4555. R=gri, iant CC=golang-dev
https://golang.org/cl/6944059
parent
bcb495b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
test/initializerr.go
test/initializerr.go
+12
-0
No files found.
test/initializerr.go
View file @
94430937
...
...
@@ -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"
,
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment