Skip to content

remove special overriding logic that was added for explicit nulls #22071

Closed
@olhotak

Description

@olhotak

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 in Context is no longer needed and should be removed.
  • def matches in class Type uses the above. Adjust.
  • The relaxedCheck parameter in def overrides in class Type should be removed.
  • isOverridingPair calls def overrides. Adjust.

cc @noti0na1

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions