Skip to content

Conversation

noti0na1
Copy link
Member

@noti0na1 noti0na1 commented Sep 2, 2025

When we compute afterPatternContext, the wrong ctx is passed to the function.

def f(s: AnyRef | Null) = s match
  case null => 0
  case s: String => s.length
  case _ =>
    val a: AnyRef = s
    a.toString.length

Will be useful for #23566

@noti0na1 noti0na1 requested review from Copilot and olhotak September 2, 2025 13:39
Copilot

This comment was marked as outdated.

@noti0na1 noti0na1 marked this pull request as ready for review September 2, 2025 14:16
Copy link
Contributor

@olhotak olhotak left a comment

Choose a reason for hiding this comment

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

LGTM

@noti0na1 noti0na1 enabled auto-merge September 2, 2025 15:13
@noti0na1 noti0na1 merged commit d84dc5c into scala:main Sep 2, 2025
44 checks passed
@noti0na1 noti0na1 deleted the fix-notnull-in-cases branch September 2, 2025 23:41
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.

2 participants