Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
2f2577a4
Commit
2f2577a4
authored
Jun 04, 2009
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug161, fixed
R=ken OCL=29907 CL=29907
parent
40192594
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
1 deletion
+24
-1
dcl.c
src/cmd/gc/dcl.c
+6
-0
subr.c
src/cmd/gc/subr.c
+1
-1
bug161.go
test/fixedbugs/bug161.go
+17
-0
No files found.
src/cmd/gc/dcl.c
View file @
2f2577a4
...
...
@@ -956,6 +956,8 @@ addvar(Node *n, Type *t, int ctxt)
s
->
vargen
=
gen
;
s
->
oname
=
n
;
s
->
offset
=
0
;
s
->
oconst
=
nil
;
s
->
otype
=
nil
;
s
->
lexical
=
LNAME
;
n
->
funcdepth
=
funcdepth
;
...
...
@@ -1003,6 +1005,8 @@ addtyp(Type *n, int ctxt)
redeclare
(
"type"
,
s
);
s
->
otype
=
n
;
s
->
oconst
=
nil
;
s
->
oname
=
nil
;
s
->
lexical
=
LATYPE
;
d
=
dcl
();
...
...
@@ -1056,6 +1060,8 @@ addconst(Node *n, Node *e, int ctxt)
redeclare
(
"constant"
,
s
);
s
->
oconst
=
e
;
s
->
otype
=
nil
;
s
->
oname
=
nil
;
s
->
lexical
=
LNAME
;
d
=
dcl
();
...
...
src/cmd/gc/subr.c
View file @
2f2577a4
...
...
@@ -1045,7 +1045,7 @@ Tpretty(Fmt *fp, Type *t)
else
fmtprint
(
fp
,
"%lS"
,
s
);
if
(
strcmp
(
s
->
package
,
package
)
==
0
)
if
(
s
->
otype
!=
t
||
(
!
s
->
export
&&
!
s
->
imported
)
)
{
if
(
(
s
->
otype
!=
t
||
!
s
->
export
)
&&
!
s
->
imported
)
{
fmtprint
(
fp
,
"·%s"
,
filename
);
if
(
t
->
vargen
)
fmtprint
(
fp
,
"·%d"
,
t
->
vargen
);
...
...
test/fixedbugs/bug161.go
0 → 100644
View file @
2f2577a4
// $G $D/$F.go || echo BUG: should compile
// 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
P
const
a
=
0
;
func
f
(
a
int
)
{
a
=
0
;
}
/*
bug161.go:8: operation LITERAL not allowed in assignment context
*/
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