]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.typealias] cmd/compile, go/importer: define export format and implement importin...
authorRobert Griesemer <gri@golang.org>
Thu, 22 Dec 2016 21:04:04 +0000 (13:04 -0800)
committerRobert Griesemer <gri@golang.org>
Tue, 10 Jan 2017 21:33:32 +0000 (21:33 +0000)
commit49de5f035169526675b9d5897753d257bf2c7965
tree70c48a530438d2d4a7d8fb31450ccddddf959a06
parent5ceec42dc0db9342bc4f37503844b46cf2689c65
[dev.typealias] cmd/compile, go/importer: define export format and implement importing of type aliases

This defines the (tentative) export/import format for type aliases.

The compiler doesn't support type aliases yet, so while the code is present
it is guarded with a flag.

The export format for embedded (anonymous) fields now has three modes (mode 3 is new):
1) The original type name and the anonymous field name are the same, and the name is exported:
   we don't need the field name and write "" instead
2) The original type name and the anonymous field name are the same, and the name is not exported:
   we don't need the field name and write "?" instead, indicating that there is package info
3) The original type name and the anonymous field name are different:
   we do need the field name and write "@" followed by the field name (and possible package info)

For #18130.

Change-Id: I790dad826757233fa71396a210f966c6256b75d3
Reviewed-on: https://go-review.googlesource.com/35100
Reviewed-by: Alan Donovan <adonovan@google.com>
src/cmd/compile/internal/gc/bexport.go
src/cmd/compile/internal/gc/bimport.go
src/go/internal/gcimporter/bimport.go