cmd/compile: wrong panic message for method call on nil of generic interface type #51521
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
The program below currently prints
FAIL interface conversion: interface is nil, not main.I
and exits with failure when built with cmd/compile. I think this is incorrect, as there's no type assertion in the user code.I believe the correct behavior is the method call
p.M()
should raise a "nil pointer dereference" panic, and so the test program should quietly exit with success.This isn't a spec compliance issue per se, as the Go spec doesn't mandate any particular panic messages. But it is inconsistent with the documentation for package runtime.
Marking for Go 1.19, because I doubt this affects any real users.
/cc @griesemer @ianlancetaylor @randall77
The text was updated successfully, but these errors were encountered: