From 4eceb7296ea921f7d5b2a381994b6a760c838cff Mon Sep 17 00:00:00 2001 From: "Hyang-Ah (Hana) Kim" Date: Mon, 9 Nov 2015 21:35:15 -0500 Subject: [PATCH] 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 --- bind/gengo.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bind/gengo.go b/bind/gengo.go index d5e863b..efc3767 100644 --- a/bind/gengo.go +++ b/bind/gengo.go @@ -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))