• Robert Griesemer's avatar
    [dev.typealias] cmd/compile, go/importer: define export format and implement... · 49de5f03
    Robert Griesemer authored
    [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/35100Reviewed-by: default avatarAlan Donovan <adonovan@google.com>
    49de5f03
bimport.go 28.6 KB