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: missing or wrong line number for invalid type #42058

Closed
cuonglm opened this issue Oct 19, 2020 · 1 comment
Closed

cmd/compile: missing or wrong line number for invalid type #42058

cuonglm opened this issue Oct 19, 2020 · 1 comment

Comments

@cuonglm
Copy link
Member

@cuonglm cuonglm commented Oct 19, 2020

What version of Go are you using (go version)?

$ go version
go version devel +9499a2e108 Sun Oct 18 08:32:19 2020 +0000 linux/amd64

Does this issue reproduce with the latest release?

Yes, both 1.14.x and 1.15.x

What operating system and processor architecture are you using (go env)?

Not relevant

What did you do?

With these programs:

package p

var c chan [2 << 16]byte

and:

package p

var c chan [2 << 16]byte

func f() {
	_ = 42
}

What did you expect to see?

Compiler emits and error, point to declaration of c.

What did you see instead?

Instead, for the first program, the line number is missing:

channel element type too large (>64kB)

The second program, the compiler point to irrelevant line (actually, lineno):

t.go:6:4: channel element type too large (>64kB)
@gopherbot
Copy link

@gopherbot gopherbot commented Oct 19, 2020

Change https://golang.org/cl/263597 mentions this issue: cmd/compile: use type position for error message in align.go

Loading

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
2 participants