diff --git a/go/gcimporter15/bexport.go b/go/gcimporter15/bexport.go index f6a55734..53b93106 100644 --- a/go/gcimporter15/bexport.go +++ b/go/gcimporter15/bexport.go @@ -119,11 +119,9 @@ func BExportData(pkg *types.Package) []byte { p.int(len(funcs)) for _, obj := range funcs { p.string(obj.Name()) - // The type can only be a signature for functions. However, by always - // writing the complete type specification (rather than just a signature) - // we keep the option open of sharing common signatures across multiple - // functions as a means to further compress the export data. - p.typ(obj.Type()) + sig := obj.Type().(*types.Signature) + p.paramList(sig.Params(), sig.Variadic()) + p.paramList(sig.Results(), false) p.int(-1) // no inlined function bodies } diff --git a/go/gcimporter15/bimport.go b/go/gcimporter15/bimport.go index 08355a3b..0ec216e9 100644 --- a/go/gcimporter15/bimport.go +++ b/go/gcimporter15/bimport.go @@ -91,7 +91,9 @@ func BImportData(imports map[string]*types.Package, data []byte, path string) (i // read funcs for i := p.int(); i > 0; i-- { name := p.string() - sig := p.typ(nil).(*types.Signature) + params, isddd := p.paramList() + result, _ := p.paramList() + sig := types.NewSignature(nil, params, result, isddd) p.int() // read and discard index of inlined function body p.declare(types.NewFunc(token.NoPos, pkg, name, sig)) }