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
gollvm/gofrontend: unnamed bool convert error #52535
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Comments
thanm
added
the
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
label
Apr 25, 2022
HangGa0
added a commit
to HangGa0/gofrontend
that referenced
this issue
May 5, 2022
There is a fix for converting unnamed bool to empty interface error. For reference see this bug in the go git repository: golang/go#52535
Change https://go.dev/cl/404496 mentions this issue: |
gopherbot
pushed a commit
that referenced
this issue
May 6, 2022
For #52535 Change-Id: I6798a8379163497ebebcdadf836b8569735c282b Reviewed-on: https://go-review.googlesource.com/c/go/+/404496 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Than McIntosh <thanm@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Ian Lance Taylor <iant@google.com>
Change https://go.dev/cl/413894 mentions this issue: |
xionghul
pushed a commit
to xionghul/gcc
that referenced
this issue
Jun 24, 2022
If a comma-ok variable already has a type, and that type is not a boolean type, then set the type of the temporary variable to bool. Otherwise we may try to convert an unnamed bool type to an interface type, which will fail. But we don't want to always use bool, because the type of the comma-ok variable may be a named bool type, in which case the assignment would fail (or need an explicit conversion). The test case is https://go.dev/cl/404496. Fixes golang/go#52535 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/413894
realqhc
pushed a commit
to realqhc/gofrontend
that referenced
this issue
Aug 4, 2022
If a comma-ok variable already has a type, and that type is not a boolean type, then set the type of the temporary variable to bool. Otherwise we may try to convert an unnamed bool type to an interface type, which will fail. But we don't want to always use bool, because the type of the comma-ok variable may be a named bool type, in which case the assignment would fail (or need an explicit conversion). The test case is https://go.dev/cl/404496. Fixes golang/go#52535 Change-Id: I15eb64824952ed8650eb6ae273c1abefb10443e3 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/413894 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Than McIntosh <thanm@google.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I got a assert fail for gollvm when compiling test/fixedbugs/issue16870.go
the assert is in function names.cc / Gogo::type_descriptor_backend_name
It is caused by the example like this.
when there is a channel/map/... used with an empty interface like this:
func test(got, want interface{})
var ok interface{}
m:=make(map[int]int)
i, ok = m[0]
test(ok,false)
If we receive the bool value from the i, ok = m[0] and convert it to an empty interface, the assert will be triggered
What did you expect to see?
test passed
What did you see instead?
compiler assert
The text was updated successfully, but these errors were encountered: