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

Fix intercept TypeApply in explicit nulls #14617

Merged

Conversation

noti0na1
Copy link
Member

@noti0na1 noti0na1 commented Mar 3, 2022

Use erased-type semantic to intercept TypeApply in explicit nulls, so the following example doesn't have warning about "the type test for argType cannot be checked at runtime".

class Symbol {
  type ThisName
}

type TermSymbol = Symbol { type ThisName = String }

def f(x: TermSymbol | Null) =
  x match
    case key: TermSymbol => 1
    case null => 0

@noti0na1 noti0na1 enabled auto-merge March 3, 2022 20:48
@noti0na1 noti0na1 merged commit b0e7265 into scala:main Mar 3, 2022
@noti0na1 noti0na1 deleted the fix-intercept-TypeApply-in-explicit-nulls branch March 3, 2022 20:58
@Kordyjan Kordyjan added this to the 3.1.3 milestone Aug 1, 2023
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.

None yet

3 participants