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
ef3e6810
Commit
ef3e6810
authored
Aug 24, 2009
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug189
R=ken OCL=33745 CL=33745
parent
ac9d833c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
4 deletions
+3
-4
src/cmd/gc/typecheck.c
src/cmd/gc/typecheck.c
+2
-0
test/fixedbugs/bug189.go
test/fixedbugs/bug189.go
+1
-1
test/golden.out
test/golden.out
+0
-3
No files found.
src/cmd/gc/typecheck.c
View file @
ef3e6810
...
...
@@ -1608,6 +1608,8 @@ typecheckcomplit(Node **np)
ll
->
n
->
left
->
typecheck
=
1
;
f
=
f
->
down
;
}
if
(
f
!=
nil
)
yyerror
(
"too few values in struct initializer"
);
}
else
{
// keyed list
for
(
ll
=
n
->
list
;
ll
;
ll
=
ll
->
next
)
{
...
...
test/bugs/bug189.go
→
test/
fixed
bugs/bug189.go
View file @
ef3e6810
...
...
@@ -13,5 +13,5 @@ type S struct {
func
main
()
{
s1
:=
S
{
a
:
7
};
// ok - field is named
s3
:=
S
{
7
,
11
};
// ok - all fields have values
s2
:=
S
{
7
};
//
bug - should not compile since not all fields have values
s2
:=
S
{
7
};
//
ERROR "too few"
}
test/golden.out
View file @
ef3e6810
...
...
@@ -157,9 +157,6 @@ BUG: errchk: command succeeded unexpectedly
=========== bugs/bug187.go
BUG: 0 1
=========== bugs/bug189.go
BUG: errchk: command succeeded unexpectedly
=========== bugs/bug190.go
bugs/bug190.go:11: invalid recursive type []S
bugs/bug190.go:16: invalid recursive type S
...
...
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