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

go/types, types2: misleading error message for type parameter field access #50516

Closed
griesemer opened this issue Jan 8, 2022 · 1 comment
Closed
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@griesemer
Copy link
Contributor

func _[P struct{f int}](x P) {
        _ = x.g
}

reports

x.g undefined (type bound for P has no method g)

but per the latest adjustments, P now has a field f and the error should refer not just to methods.

cc: @findleyr

@griesemer griesemer added the NeedsFix The path to resolution is known, but the work has not been done. label Jan 8, 2022
@griesemer griesemer added this to the Go1.18 milestone Jan 8, 2022
@griesemer griesemer self-assigned this Jan 8, 2022
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/376954 mentions this issue: go/types, types2: better error message for type parameter field access

jproberts pushed a commit to jproberts/go that referenced this issue Jun 21, 2022
Fixes golang#50516.

Also call DefPredeclaredTestFuncs in TestFixedbugs so it can be
run independently again.

Change-Id: I78d4cc11790b1543a2545a7ab297a223b3d5e3c8
Reviewed-on: https://go-review.googlesource.com/c/go/+/376954
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
@golang golang locked and limited conversation to collaborators Jun 22, 2023
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.
Projects
None yet
Development

No branches or pull requests

2 participants