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
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
2 participants