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

Implement SIP 57 - add runtimeChecked method and annotation #20987

Merged
merged 2 commits into from
Jul 24, 2024

Conversation

bishabosha
Copy link
Member

@bishabosha bishabosha commented Jul 3, 2024

ref: https://docs.scala-lang.org/sips/replace-nonsensical-unchecked-annotation.html

Also this doesn't change synthetic code that is generated to use @unchecked, or make @unchecked meaningless for this use case - this should probably come at a later stage after the definition is no longer experimental

fixes #21012

@bishabosha
Copy link
Member Author

bishabosha commented Jul 3, 2024

For the future: once the definition is stabilised, we can deprecate @unchecked in this use case, switch over code generation, semantic checks, error messages to use .runtimeChecked instead of : @unchecked

And also later possibly a language mode could introduce that refutable pattern bindings become an error?

@bishabosha bishabosha marked this pull request as ready for review July 3, 2024 20:54
@bishabosha bishabosha marked this pull request as draft July 4, 2024 09:29
@bishabosha bishabosha marked this pull request as ready for review July 4, 2024 11:40
@bishabosha bishabosha requested a review from odersky July 4, 2024 13:20
@bishabosha bishabosha requested a review from Gedochao July 16, 2024 16:34
@bishabosha
Copy link
Member Author

@Gedochao how can I get this reviewed?

Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

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

I left some suggestions for the doc page. Otherwise LGTM.

docs/_docs/reference/experimental/runtimeChecked.md Outdated Show resolved Hide resolved
docs/_docs/reference/experimental/runtimeChecked.md Outdated Show resolved Hide resolved
docs/_docs/reference/experimental/runtimeChecked.md Outdated Show resolved Hide resolved
docs/_docs/reference/experimental/runtimeChecked.md Outdated Show resolved Hide resolved
docs/_docs/reference/experimental/runtimeChecked.md Outdated Show resolved Hide resolved
docs/_docs/reference/experimental/runtimeChecked.md Outdated Show resolved Hide resolved
docs/_docs/reference/experimental/runtimeChecked.md Outdated Show resolved Hide resolved
docs/_docs/reference/experimental/runtimeChecked.md Outdated Show resolved Hide resolved
docs/_docs/reference/experimental/runtimeChecked.md Outdated Show resolved Hide resolved
@odersky odersky assigned bishabosha and unassigned odersky Jul 19, 2024
@bishabosha bishabosha requested a review from odersky July 19, 2024 20:00
bishabosha and others added 2 commits July 24, 2024 10:01
improve documentation based on suggestions

Co-authored-by: odersky <odersky@gmail.com>
@bishabosha bishabosha merged commit a64c295 into scala:main Jul 24, 2024
25 checks passed
@bishabosha bishabosha deleted the sip-57-unchecked-annot branch July 24, 2024 09:25
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.

[SIP 57] Add runtimeChecked method to replace @unchecked in the context that means "check at runtime"
2 participants