Skip to content

Fix final vals #771

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

Merged
merged 10 commits into from
Aug 24, 2015
Merged

Fix final vals #771

merged 10 commits into from
Aug 24, 2015

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Aug 23, 2015

An implementation of SIP 23 and fixes to constant propagation and code generation for constants. SIP 23 was added because it makes testing easier. Review by @DarkDimius

Only the parser needed to be updated. Everything else works out of the box.
This duplicates scalac behavior. Awaiting inline, this is a stopgap because we need this to work
for the bootstrap. Once we have inline (and a migration tool that rewrites final to final inline)
we can migrate this functionality over to inline values.
As the comment in pos/singletons.scala says, we currently
test only constant propagation during typer. We should also have a
test that literalize produces the literals in the right places.
It's decided that constant types and purity are independent.
Null and 'sym are not legal as singleton types because the underlying
values are not stable. They are rejected now outright instead of issuing
a cryptic "X is not stable" error message.
Tested are now other numeric values, strings, booleans, which are
all legal singleton types.
Introduce a new non-terminal "SimpleLiteral". Only SimpleLiterals can be
types.
@DarkDimius
Copy link
Contributor

LGTM

DarkDimius added a commit that referenced this pull request Aug 24, 2015
@DarkDimius DarkDimius merged commit b779f16 into scala:master Aug 24, 2015
@allanrenucci allanrenucci deleted the fix-final-vals branch December 14, 2017 19:20
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.

3 participants