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 #20372: Check pattern match exhaustivity in inlined code #20403

Merged
merged 1 commit into from
May 20, 2024

Conversation

jchyb
Copy link
Contributor

@jchyb jchyb commented May 14, 2024

Fixes #20372
c0e93f1 previously disabled warnings for pattern matches in Inlined code, as things like:

inline def count(inline x: Boolean) = x match
    case true => 1
    case false => 0
count(true) // inlined to true match {case true => 1; case false => 0 }

would throw warnings about unreachable cases, which could have been confusing to the users. However, in those cases it should be enough to disallow checks for unreachable cases specifically, and leave exhaustivity checks intact.

@hamzaremmal hamzaremmal merged commit 8563571 into scala:main May 20, 2024
19 checks passed
@hamzaremmal hamzaremmal deleted the fix-i20372 branch May 20, 2024 16:49
@Kordyjan Kordyjan added this to the 3.5.1 milestone Jul 3, 2024
WojciechMazur added a commit that referenced this pull request Jul 8, 2024
…e" to LTS (#21115)

Backports #20403 to the LTS branch.

PR submitted by the release tooling.
[skip ci]
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.

Exhaustivity warnings not applied to code passed to inline method
3 participants