Skip to content

Conversation

HarrisL2
Copy link
Contributor

@HarrisL2 HarrisL2 commented Sep 12, 2025

More tests may be needed

Fixes #23908

@sjrd
Copy link
Member

sjrd commented Sep 12, 2025

It looks like this PR was initiated on top of the wrong branch. Please rebase on top of main and only include the relevant commit.

|| tp.isRef(defn.UnitClass)
// We don't modify `Any` because it's already nullable.
|| tp.isRef(defn.AnyClass) => false
case tp: TypeParamRef if !tp.hasSimpleKind => false
Copy link
Member

Choose a reason for hiding this comment

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

!tp.hasSimpleKind can be moved to the first if together with outermostLevelAlreadyNullable.

case tp: TypeRef if !tp.hasSimpleKind
// We don't modify value types because they're non-nullable even in Java.
|| tp.symbol.isValueClass
|| tp.isRef(defn.NullClass)
Copy link
Member

Choose a reason for hiding this comment

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

We may also need to consider the following special classes: SingletonClass, AnyKindClass, FromJavaObjectSymbol, etc...

val n1: List[Map[String, Int]] = ???
val n2 = new N[List]()
val n3 = n2.accept[Any](n1)

Copy link
Member

Choose a reason for hiding this comment

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

Let's also test some type lambdas like [X] =>> R

@HarrisL2
Copy link
Contributor Author

Closed as subsumed by #23938

@HarrisL2 HarrisL2 closed this Sep 17, 2025
noti0na1 added a commit that referenced this pull request Sep 22, 2025
…llification rules (#23938)

Given the nightly results, we think the nullification rules still need
some polish and is not ready for all compiled Scala code. Hence, we only
nullify tasty if `Ynullify-tasty` is set now.

Based on #23911

Fixes #23908

Could fix #23933, #23935, #23936, and #23937 (I tested locally due the
explicit nulls tests disabled temprarily)
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.

Crash with FlexibleTypes when nullifying classes with Higher-kinded Type Parameters
3 participants