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

cmd/compile: failure to compile interface{}(1<<s + 1<<s) #24763

Closed
mdempsky opened this issue Apr 8, 2018 · 4 comments
Closed

cmd/compile: failure to compile interface{}(1<<s + 1<<s) #24763

mdempsky opened this issue Apr 8, 2018 · 4 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@mdempsky
Copy link
Member

mdempsky commented Apr 8, 2018

https://play.golang.org/p/Pt6pzZ09C_7

package main

func main() {
	var s uint
	var x = interface{}(1<<s + 1<<s)
	println(x)
}

cmd/compile fails to compile this program, and instead outputs "prog.go:5:27: internal compiler error: unhandled binary op + INTER". go/types accepts it.

@mdempsky mdempsky added the NeedsFix The path to resolution is known, but the work has not been done. label Apr 8, 2018
@ianlancetaylor
Copy link
Contributor

Works with gccgo.

@gopherbot
Copy link

Change https://golang.org/cl/112278 mentions this issue: cmd/compile: fix wrong op when converting an IDEAL to an interface

@choleraehyq
Copy link
Contributor

Seems converting to interface will be handled in convertop, so we shouldn't set type to t directly when t is an interface type (const.go:249).

@gopherbot
Copy link

Change https://golang.org/cl/121335 mentions this issue: cmd/compile: don't crash in untyped expr to interface conversion

@golang golang locked and limited conversation to collaborators Jun 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

4 participants