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: inlining signed shift from Go 1.13 package into Go 1.12 package causes compilation error #35442

Closed
mdempsky opened this issue Nov 7, 2019 · 3 comments
Labels
Milestone

Comments

@mdempsky
Copy link
Member

@mdempsky mdempsky commented Nov 7, 2019

This should probably compile:

$ cat a.go
package a

func F(x, y int) int { return x << y }

$ cat b.go
package b

import "./a"

func f() { a.F(0, 0) }

$ go tool compile -lang=go1.13 a.go
$ go tool compile -lang=go1.12 b.go
/tmp/a.go:3:33: invalid operation: a.x << a.y (signed shift count type int) requires go1.13 or later (-lang was set to go1.12; check go.mod)

Related: #35437

/cc @bcmills @griesemer

@mdempsky mdempsky added the NeedsFix label Nov 7, 2019
@griesemer

This comment has been minimized.

Copy link
Contributor

@griesemer griesemer commented Nov 7, 2019

Agreed.

@griesemer griesemer added this to the Go1.14 milestone Nov 7, 2019
@griesemer

This comment has been minimized.

Copy link
Contributor

@griesemer griesemer commented Nov 7, 2019

Not a regression, but would be nice to get fixed.

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Nov 8, 2019

Change https://golang.org/cl/205977 mentions this issue: cmd/compile: don't apply -lang=go1.X restrictions to imported packages

@gopherbot gopherbot closed this in b7d097a Nov 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.