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
5ee2b047
Commit
5ee2b047
authored
Sep 03, 2008
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update bugs
add test for composite literals R=gri OCL=14766 CL=14766
parent
ce04d019
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
18 deletions
+46
-18
test/complit.go
test/complit.go
+44
-0
test/fixedbugs/bug047.go
test/fixedbugs/bug047.go
+1
-1
test/fixedbugs/bug048.go
test/fixedbugs/bug048.go
+1
-2
test/golden.out
test/golden.out
+0
-15
No files found.
test/complit.go
0 → 100644
View file @
5ee2b047
// $G $F.go && $L $F.$A && ./$A.out
// 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
T
struct
{
i
int
;
f
float
;
s
string
;
next
*
T
}
func
main
()
{
var
t
T
;
t
=
T
(
0
,
7.2
,
"hi"
,
&
t
);
var
tp
*
T
;
tp
=
&
T
(
0
,
7.2
,
"hi"
,
&
t
);
a1
:=
[]
int
(
1
,
2
,
3
);
if
len
(
a1
)
!=
3
{
panic
(
"a1"
)
}
a2
:=
[
10
]
int
(
1
,
2
,
3
);
if
len
(
a2
)
!=
10
||
a2
[
3
]
!=
0
{
panic
(
"a2"
)
}
//a3 := [10]int(1,2,3,); // BUG: trailing commas not allowed
//if len(a3) != 10 || a2[3] != 0 { panic("a3") }
var
oai
*
[]
int
;
oai
=
&
[]
int
(
1
,
2
,
3
);
if
len
(
oai
)
!=
3
{
panic
(
"oai"
)
}
at
:=
[]
*
T
(
&
t
,
&
t
,
&
t
);
if
len
(
at
)
!=
3
{
panic
(
"at"
)
}
c
:=
new
(
chan
int
);
ac
:=
[]
*
chan
int
(
c
,
c
,
c
);
if
len
(
ac
)
!=
3
{
panic
(
"ac"
)
}
aat
:=
[][
len
(
at
)]
*
T
(
at
,
at
);
if
len
(
aat
)
!=
2
||
len
(
aat
[
1
])
!=
3
{
panic
(
"at"
)
}
s
:=
string
([]
byte
(
'h'
,
'e'
,
'l'
,
'l'
,
'o'
));
if
s
!=
"hello"
{
panic
(
"s"
)
}
m
:=
map
[
string
]
float
(
"one"
:
1.0
,
"two"
:
2.0
,
"pi"
:
22.
/
7.
);
if
len
(
m
)
!=
3
{
panic
(
"m"
)
}
}
test/bugs/bug047.go
→
test/
fixed
bugs/bug047.go
View file @
5ee2b047
...
...
@@ -17,5 +17,5 @@ func main() {
t
:=
T
(
s
,
f
);
type
M
map
[
int
]
int
;
m0
:=
M
(
7
,
8
);
m0
:=
M
(
7
:
8
);
}
test/bugs/bug048.go
→
test/
fixed
bugs/bug048.go
View file @
5ee2b047
...
...
@@ -8,6 +8,5 @@ package main
func
main
()
{
type
M
map
[
int
]
int
;
m0
:=
M
(
7
,
8
);
// parses OK
m1
:=
M
(
7
:
8
);
// BUG: syntax error (grammar but not doc has [a:b]; what should we do?
m1
:=
M
(
7
:
8
);
}
test/golden.out
View file @
5ee2b047
...
...
@@ -71,21 +71,6 @@ BUG: compilation succeeds incorrectly
=========== bugs/bug041.go
BUG: compilation succeeds incorrectly
=========== bugs/bug047.go
bugs/bug047.go:16: illegal types for operand: CONV
(MAP[<int32>INT32]<int32>INT32)
bugs/bug047.go:16: illegal types for operand: CONV
(MAP[<int32>INT32]<int32>INT32)
BUG: known to fail incorrectly
=========== bugs/bug048.go
bugs/bug048.go:7: illegal types for operand: CONV
(MAP[<int32>INT32]<int32>INT32)
bugs/bug048.go:8: syntax error
bugs/bug048.go:7: illegal types for operand: CONV
(MAP[<int32>INT32]<int32>INT32)
BUG: known to fail incorrectly
=========== bugs/bug061.go
BUG: known to fail incorrectly
Bus error $G $D/$F.go
...
...
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