diff options
author | Robert Griesemer <gri@golang.org> | 2016-10-25 14:09:18 -0700 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2016-10-27 17:44:45 +0000 |
commit | 03d81b5ed91dfb3a2d1041bfe80dd94e7f06a3c4 (patch) | |
tree | e4cd0b9b39f921dbdfb2e3ff0827be48106d887a /test/alias2.go | |
parent | 81038d2e2b588f9df45d20a2ca0be446b0e421b2 (diff) | |
download | go-03d81b5ed91dfb3a2d1041bfe80dd94e7f06a3c4.tar.gz go-03d81b5ed91dfb3a2d1041bfe80dd94e7f06a3c4.zip |
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>
Diffstat (limited to 'test/alias2.go')
-rw-r--r-- | test/alias2.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/alias2.go b/test/alias2.go index a09f524611..f160d384b1 100644 --- a/test/alias2.go +++ b/test/alias2.go @@ -50,7 +50,7 @@ func f => before.f // ERROR "before is not a package" var v => after.m // ERROR "after is not a package" func f => after.m // ERROR "after is not a package" -// TODO(gri) fix error printing - should not print a qualified identifier... +// TODO(gri) fix error printing - should print correct qualified identifier... var _ => Default.ARCH // ERROR "build.Default is not a package" // aliases may not refer to package unsafe @@ -77,11 +77,11 @@ func sin1 => math.Pi // ERROR "math.Pi is not a function" // alias reference to a package marks package as used func _ => fmt.Println -// TODO(gri) aliased cannot be exported yet - fix this -const Pi => math.Pi // ERROR "cannot export alias Pi" -type Writer => io.Writer // ERROR "cannot export alias Writer" -var Def => build.Default // ERROR "cannot export alias Def" -func Sin => math.Sin // ERROR "cannot export alias Sin" +// re-exported aliases +const Pi => math.Pi +type Writer => io.Writer +var Def => build.Default +func Sin => math.Sin // type aliases denote identical types type myPackage => build.Package |