2
0
mirror of synced 2025-02-23 14:58:12 +00:00

bind: error on named basic types

error message example:

 gomobile: unsupported named type github.com/sridharv/bugreports/typealiasmissing.Alias

Objective-C and Java generation code currently panics, which need to be
fixed separately. (See TODO in bind/seq.go)

Fixes golang/go#13190

Change-Id: Ie46dc58ea800522b8ab7cb8ac662ad561e0ca82e
Reviewed-on: https://go-review.googlesource.com/16780
Reviewed-by: Burcu Dogan <jbd@google.com>
This commit is contained in:
Hyang-Ah (Hana) Kim 2015-11-09 21:35:15 -05:00 committed by Hyang-Ah Hana Kim
parent 9c6db08f1d
commit 4eceb7296e

View File

@ -333,7 +333,7 @@ func (g *goGen) genRead(valName, seqName string, typ types.Type) {
g.Printf("%s_ref := %s.ReadRef()\n", valName, seqName)
g.Printf("%s := %s_ref.Get().(*%s.%s)\n", valName, valName, g.pkg.Name(), o.Name())
default:
g.errorf("unsupported type %s", t)
g.errorf("unsupported pointer type %s", t)
}
case *types.Named:
switch t.Underlying().(type) {
@ -356,6 +356,8 @@ func (g *goGen) genRead(valName, seqName string, typ types.Type) {
g.Printf(" %s = (*proxy%s)(%s_ref)\n", valName, o.Name(), valName)
}
g.Printf("}\n")
default:
g.errorf("unsupported named type %s", t)
}
default:
g.Printf("%s := %s.Read%s()\n", valName, seqName, seqType(t))