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: //go:nointerface error misreported as ICE #63333

Closed
mdempsky opened this issue Oct 2, 2023 · 3 comments
Closed

cmd/compile: //go:nointerface error misreported as ICE #63333

mdempsky opened this issue Oct 2, 2023 · 3 comments
Assignees
Labels
NeedsFix The path to resolution is known, but the work has not been done.

Comments

@mdempsky
Copy link
Contributor

mdempsky commented Oct 2, 2023

Compiling this package with GOEXPERIMENT=fieldtrack causes an ICE, when it should just report a compiler error:

package p

func f(interface{ m() }) {}
func g() { f(new(T)) }

type T struct {}

//go:nointerface
func (*T) m() {}
@mdempsky mdempsky added the NeedsFix The path to resolution is known, but the work has not been done. label Oct 2, 2023
@mdempsky mdempsky self-assigned this Oct 2, 2023
@cuonglm
Copy link
Member

cuonglm commented Oct 3, 2023

This seems to be present since -G=3 added.

The old typechecker problem exposed by https://go-review.googlesource.com/c/go/+/394575.

I'm not sure what's the best place to address this, types2 does not know about go:nointerface pragma.

@cuonglm
Copy link
Member

cuonglm commented Oct 3, 2023

I'm not sure what's the best place to address this, types2 does not know about go:nointerface pragma.

Probably we should just error out during tcConv instead of fatal. That would catch invalid conversion due to go pragma.

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/532515 mentions this issue: cmd/compile: do not fatal when typechecking conversion expression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants