Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/mobile/cmd/gomobile: using bool in exported functions panics #10855

Closed
eliasnaur opened this issue May 14, 2015 · 1 comment
Closed

x/mobile/cmd/gomobile: using bool in exported functions panics #10855

eliasnaur opened this issue May 14, 2015 · 1 comment

Comments

@eliasnaur
Copy link
Contributor

gomobile bind in a package containing only test.go with this content:

package test

func Hello(b bool) {
}

results in a panic:

panic: unsupported basic seqType: bool

goroutine 1 [running]:
golang.org/x/mobile/bind.seqType(0x7f10d1696318, 0xc869a0, 0x0, 0x0)
/home/elias/dev/go/src/golang.org/x/mobile/bind/seq.go:41 +0xd15
golang.org/x/mobile/bind.(_goGen).genRead(0xc20811b930, 0xc208015760, 0x7, 0x9e85f0, 0x2, 0x7f10d1696318, 0xc869a0)
/home/elias/dev/go/src/golang.org/x/mobile/bind/gengo.go:355 +0x19f6
golang.org/x/mobile/bind.(_goGen).genFuncBody(0xc20811b930, 0xc208017780, 0xc208015560, 0x4)
/home/elias/dev/go/src/golang.org/x/mobile/bind/gengo.go:50 +0x1c3
golang.org/x/mobile/bind.(_goGen).genFunc(0xc20811b930, 0xc208017780)
/home/elias/dev/go/src/golang.org/x/mobile/bind/gengo.go:130 +0x2fa
golang.org/x/mobile/bind.(_goGen).gen(0xc20811b930, 0x0, 0x0)
/home/elias/dev/go/src/golang.org/x/mobile/bind/gengo.go:408 +0xabb
golang.org/x/mobile/bind.GenGo(0x7f10d1696220, 0xc20802a160, 0xc2080175c0, 0xc208013680, 0x0, 0x0)
/home/elias/dev/go/src/golang.org/x/mobile/bind/bind.go:45 +0x198
main.(_binder).GenGo.func1(0x7f10d1696220, 0xc20802a160, 0x0, 0x0)
/home/elias/dev/go/src/golang.org/x/mobile/cmd/gomobile/bind.go:198 +0x54
main.writeFile(0xc2080178c0, 0x34, 0xc20811bb10, 0x0, 0x0)
/home/elias/dev/go/src/golang.org/x/mobile/cmd/gomobile/bind.go:230 +0x352
main.(_binder).GenGo(0xc20810ef30, 0xc20810e990, 0x21, 0x0, 0x0)
/home/elias/dev/go/src/golang.org/x/mobile/cmd/gomobile/bind.go:200 +0x401
main.runBind(0xc8b140, 0x0, 0x0)
/home/elias/dev/go/src/golang.org/x/mobile/cmd/gomobile/bind.go:118 +0x466
main.main()
/home/elias/dev/go/src/golang.org/x/mobile/cmd/gomobile/main.go:63 +0x479

even though https://godoc.org/golang.org/x/mobile/cmd/gobind says boolean types are supported.

@gopherbot
Copy link

CL https://golang.org/cl/10046 mentions this issue.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 10, 2021
Also add missing int8/int16 handling in bind/seq.

Fixes golang/go#10855.

Change-Id: I326ada44df10fc3c22628bdd2ae4ee2c3dc7902e
Reviewed-on: https://go-review.googlesource.com/10046
Reviewed-by: Alan Donovan <adonovan@google.com>
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 11, 2021
Also add missing int8/int16 handling in bind/seq.

Fixes golang/go#10855.

Change-Id: I326ada44df10fc3c22628bdd2ae4ee2c3dc7902e
Reviewed-on: https://go-review.googlesource.com/10046
Reviewed-by: Alan Donovan <adonovan@google.com>
@rsc rsc unassigned hyangah Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants