Change-Id: I1cd7a77617658c057c863bd311470f1f22062aee
Reviewed-on: https://go-review.googlesource.com/21900
Reviewed-by: Alan Donovan <adonovan@google.com>
This commit is contained in:
Robert Griesemer 2016-04-12 12:31:05 -07:00
parent 51487f711d
commit b9ac36caf8
2 changed files with 3 additions and 11 deletions

View File

@ -91,10 +91,6 @@ func BExportData(pkg *types.Package) []byte {
// write package data
p.pkg(pkg, true)
// write compiler-specific flags
p.string("") // no flags to write in our case
if trace {
p.tracef("\n")
}

View File

@ -82,9 +82,6 @@ func BImportData(imports map[string]*types.Package, data []byte, path string) (i
panic("imported packaged not found in pkgList[0]")
}
// read compiler-specific flags
p.string() // discard
// read objects of phase 1 only (see cmd/compiler/internal/gc/bexport.go)
objcount := 0
for {
@ -197,7 +194,7 @@ func (p *importer) obj(tag int) {
p.declare(types.NewFunc(token.NoPos, pkg, name, sig))
default:
panic("unexpected object tag")
panic(fmt.Sprintf("unexpected object tag %d", tag))
}
}
@ -236,8 +233,7 @@ func (p *importer) typ(parent *types.Package) types.Type {
switch i {
case namedTag:
// read type object
name := p.string()
parent = p.pkg()
parent, name := p.qualifiedName()
scope := parent.Scope()
obj := scope.Lookup(name)
@ -262,7 +258,7 @@ func (p *importer) typ(parent *types.Package) types.Type {
t0.SetUnderlying(p.typ(parent))
// interfaces don't have associated methods
if _, ok := t0.Underlying().(*types.Interface); ok {
if types.IsInterface(t0) {
return t
}