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

Disallow bottom types in erased implementations #14267

Conversation

nicolasstucki
Copy link
Contributor

Forces users to use a more sensible implementation for erased definitions

- erased def f: T = ???
- erased def f: T = null
+ erased def f: T = new T
+ erased def f: T = compiletime.erasedValue

The erased value generated by a `try` is now a reference to `erasedValue` like other generated erased expressions. We also remove the `Lazy` as it is semantically meaningless in an erased definition.
@nicolasstucki nicolasstucki force-pushed the disallow-bottom-types-in-erased-implementations branch from fcf93db to 658ee6e Compare January 14, 2022 15:18
@nicolasstucki nicolasstucki force-pushed the disallow-bottom-types-in-erased-implementations branch from 658ee6e to 51f60b6 Compare January 17, 2022 08:59
@nicolasstucki nicolasstucki marked this pull request as ready for review January 17, 2022 11:10
@smarter smarter merged commit 7939ddb into scala:master Jan 17, 2022
@smarter smarter deleted the disallow-bottom-types-in-erased-implementations branch January 17, 2022 12:36
@Kordyjan Kordyjan added this to the 3.1.2 milestone Aug 2, 2023
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.

None yet

3 participants