commit 1ec5108
I compiled the following (incorrect) code: https://gotipplay.golang.org/p/NF9UzMFrJG1
type S[A, B any] struct {
F int
}
func f[A any](s S[A]) {
s.F = 1
}
I see these error messages:
./prog.go:10:17: cannot infer B (prog.go:6:11)
./prog.go:10:17: got 1 arguments but 2 type parameters
./prog.go:11:4: s.F undefined (type S[A] has no field or method F)
The last error message is misleading because S actually does have a field named F even if it hasn't been instantiated with the required type parameters.
commit 1ec5108
I compiled the following (incorrect) code: https://gotipplay.golang.org/p/NF9UzMFrJG1
I see these error messages:
The last error message is misleading because
Sactually does have a field namedFeven if it hasn't been instantiated with the required type parameters.