]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix typecheck type alias makes wrong export symbol metadata
authorLE Manh Cuong <cuong.manhle.vn@gmail.com>
Wed, 15 May 2019 19:28:47 +0000 (02:28 +0700)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 21 May 2019 17:44:21 +0000 (17:44 +0000)
commit2d357d8da864fc8d14e7e7834d521aa638243772
tree3ee25e756c495218864199144a4d7c3ef0a78f80
parent1d1ba85d9986bb56226046c06dec4ce63ef9fe48
cmd/compile: fix typecheck type alias makes wrong export symbol metadata

typecheck type alias always replaces the original definition of the symbol.
This is wrong behavior because if the symbol's definition is replaced by a
local type alias, it ends up being written to compiled file as an alias,
instead of the original type.

To fix, only replace the definition of symbol with global type alias.

Fixes #31959

Change-Id: Id85a15e8a9d6a4b06727e655a95dc81e63df633a
Reviewed-on: https://go-review.googlesource.com/c/go/+/177378
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/typecheck.go
test/fixedbugs/issue31959.dir/a.go [new file with mode: 0644]
test/fixedbugs/issue31959.dir/main.go [new file with mode: 0644]
test/fixedbugs/issue31959.go [new file with mode: 0644]
test/fixedbugs/issue31959.out [new file with mode: 0644]