Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove special overriding logic for explicit nulls #22243

Merged
merged 5 commits into from
Jan 21, 2025
Merged

Conversation

HarrisL2
Copy link
Contributor

Fixes #22071

@olhotak
Copy link
Contributor

olhotak commented Dec 19, 2024

The changes LGTM, but we'll need to get the CI running first.

There we see:

object creation impossible, since def compareTo(x$0: T | Null): Int in trait Comparable in package java.lang is not defined

The type of x should become a flexible type, not T | Null. So the question is why doesn't it become a flexible type.

Copy link
Member

@noti0na1 noti0na1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question about the ctx for matches. Otherwise LGTM

Comment on lines -1199 to -1200
val overrideCtx = if ctx.explicitNulls then ctx.relaxedOverrideContext else ctx
TypeComparer.matchesType(this, that, relaxed = !ctx.phase.erasedTypes)(using overrideCtx)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need to remove the SafeNull mode?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I believe the comment above explains why. (and it also doesn't pass the tests without it)

@HarrisL2 HarrisL2 requested a review from noti0na1 January 14, 2025 19:05
@noti0na1 noti0na1 merged commit 3f2365d into scala:main Jan 21, 2025
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

remove special overriding logic that was added for explicit nulls
3 participants