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
7b240e81
Commit
7b240e81
authored
Jul 26, 2010
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gc: import dot shadowing bug
R=ken2 CC=golang-dev
https://golang.org/cl/1873047
parent
ad4f95d3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
typecheck.c
src/cmd/gc/typecheck.c
+5
-0
bug295.go
test/fixedbugs/bug295.go
+17
-0
No files found.
src/cmd/gc/typecheck.c
View file @
7b240e81
...
...
@@ -1781,6 +1781,11 @@ typecheckcomplit(Node **np)
typecheck
(
&
l
->
right
,
Erv
);
continue
;
}
// Sym might have resolved to name in other top-level
// package, because of import dot. Redirect to correct sym
// before we do the lookup.
if
(
s
->
pkg
!=
localpkg
)
s
=
lookup
(
s
->
name
);
l
->
left
=
newname
(
s
);
l
->
left
->
typecheck
=
1
;
f
=
lookdot1
(
s
,
t
,
t
->
type
,
0
);
...
...
test/fixedbugs/bug295.go
0 → 100644
View file @
7b240e81
// $G $D/$F.go && $L $F.$A && ./$A.out
// Copyright 2010 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
import
.
"testing"
// defines top-level T
type
S
struct
{
T
int
}
func
main
()
{
_
=
&
S
{
T
:
1
}
// should work
}
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