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

Comments

@mdempsky
Copy link
Member

@mdempsky 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 label Apr 8, 2018
@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Apr 11, 2018

Works with gccgo.

@ianlancetaylor ianlancetaylor added this to the Go1.11 milestone Apr 18, 2018
@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented May 9, 2018

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

@choleraehyq

This comment has been minimized.

Copy link
Contributor

@choleraehyq choleraehyq commented May 9, 2018

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

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jun 27, 2018

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

@gopherbot gopherbot closed this in b410ce7 Jun 28, 2018
@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.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.