Go 1.19 (and tip):
package p
var x struct{ f *NotAType }
var _ = x.f == nil
var y *NotAType
var _ = y == nil
./prog.go:3:18: undefined: NotAType
./prog.go:4:16: invalid operation: x.f == nil (operator == not defined on untyped nil)
./prog.go:6:8: undefined: NotAType
The second error, on line 4, should not be printed.
Note that there is no second error involving y.
Something about the struct field is confusing the matter.
https://go.dev/play/p/UQP8ZveEPVh
Go 1.19 (and tip):
The second error, on line 4, should not be printed.
Note that there is no second error involving y.
Something about the struct field is confusing the matter.
https://go.dev/play/p/UQP8ZveEPVh