Skip to content

Commit

Permalink
bind: error on named basic types
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
hyangah committed Nov 11, 2015
1 parent 9c6db08 commit 4eceb72
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bind/gengo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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))
Expand Down

0 comments on commit 4eceb72

Please sign in to comment.