Closed
Description
When the explicit nulls feature was added, we added special logic in overriding checks to allow existing overriding pairs between Java-defined and Scala-defined classes. For example, if a Java method has a String
parameter, it should be allowed to be overridden by a Scala method with a String
parameter, but explicit nulls would interpret the Java String
parameter as String|Null
and would forbid the overriding in the absence of such special logic.
Now that Java types are interpreted using flexible types, that special overriding logic is no longer needed and should be removed.
Here are some areas affected by the logic:
- The
RelaxedOverriding
Mode
should be removed entirely. relaxedOverrideContext
inContext
is no longer needed and should be removed.def matches
in classType
uses the above. Adjust.- The
relaxedCheck
parameter indef overrides
in classType
should be removed. isOverridingPair
callsdef overrides
. Adjust.
cc @noti0na1