Open vasslitvinov opened 5 years ago
I don't think this question is urgent in any way. The old-style runtime check can be there, even if it is unnecessary, and it will be omitted on --fast
compiles so it arguably shouldn't impact performance-oriented compiles. I think we should revisit this after the 1.20 release.
The following code, compiled in the
--legacy-nilable-classes
mode:upon
x.myMethod()
at run time invokes the nil check that we have had for a long time, one that is disabled upon--fast
.When switching to
--no-legacy-nilable-classes
,x
has to be given a nilable type and the method call has to be preceded byx!
. This is a different kind of check.This issue inquires whether the old-style runtime nil check will still live in the world where there is no
--legacy-nilable-classes
, and if so, how to write a test to exercise it.Right now it is tested with:
Meta: this is applicable only when we remove the
legacy-nilable-classes
option.