-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Make runtimeChecked a standard feature #23262
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
base: main
Are you sure you want to change the base?
Conversation
Follow up should be to recommend this instead of |
@bishabosha The last commit changes the one occurrence of |
@@ -922,7 +922,7 @@ class UncheckedTypePattern(argType: Type, whyNot: String)(using Context) | |||
i"""|Type arguments and type refinements are erased during compile time, thus it's | |||
|impossible to check them at run-time. | |||
| | |||
|You can either replace the type arguments by ${hl("_")} or use `@unchecked`. | |||
|You can either replace the type arguments by ${hl("_")} or use `.runtimeChecked`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually this error message is the one legitimate use for unchecked, case _: List[Int @unchecked] =>
the other error message is elsewhere - but as I type this I'm not at my computer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, well spotted. I'll revert the commit.
The runtimeChecked implementation was accepted in the SIP meeting of May 23, 2025. Since the the feature has been around for long, and is quite uncontroversial, I think we can just merge it for 3.8. No preview phase should be needed.
0cce292
to
057ea91
Compare
Co-authored-by: Matt Bovel <[email protected]>
The runtimeChecked implementation was accepted in the SIP meeting of May 23, 2025. Since the feature has been around for long, and is quite uncontroversial, I think we can just merge it for 3.8. No preview phase should be needed.
We should merge this PR for 3.8 RC1.