mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: import/export of alias declarations
This CL completes support for alias declarations in the compiler. Also: - increased export format version - updated various comments For #16339. Fixes #17487. Change-Id: Ic6945fc44c0041771eaf9dcfe973f601d14de069 Reviewed-on: https://go-review.googlesource.com/32090 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
81038d2e2b
commit
03d81b5ed9
11 changed files with 291 additions and 61 deletions
|
|
@ -928,7 +928,7 @@ func mkpackage(pkgname string) {
|
|||
continue
|
||||
}
|
||||
|
||||
if s.Def.Sym != s {
|
||||
if s.Def.Sym != s && s.Flags&SymAlias == 0 {
|
||||
// throw away top-level name left over
|
||||
// from previous import . "x"
|
||||
if s.Def.Name != nil && s.Def.Name.Pack != nil && !s.Def.Name.Pack.Used && nsyntaxerrors == 0 {
|
||||
|
|
@ -936,8 +936,6 @@ func mkpackage(pkgname string) {
|
|||
s.Def.Name.Pack.Used = true
|
||||
}
|
||||
|
||||
// TODO(gri) This will also affect exported aliases.
|
||||
// Need to fix this.
|
||||
s.Def = nil
|
||||
continue
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue