Skip to content

Value class related checks #710

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 4 commits into from
Jul 2, 2015

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Jul 2, 2015

Most of the restrictions on value classes were not enforced. This PR addresses the majority of them. It also enforces restrictions on inheriting from final and sealed classes, which was also missing so far.

review by @smarter

odersky added 4 commits July 2, 2015 14:02
So far no error was raised for illegal inheritance
from final or sealed classes.
According to SIP 15 a value class C must obey the following restrictions:

C may not have secondary constructors.
C may not declare fields (other than the parameter of a value class).
C may not contain object definitions.
C may not have initialization statements.

These are enforced by this commit. We are still missing restrictions on
value class paremeters. We should review what the right set of conditions
is (probably we want to admit non-vals, and maybe even multiple
parameters).
@odersky
Copy link
Contributor Author

odersky commented Jul 2, 2015

Fixes #705

@smarter
Copy link
Member

smarter commented Jul 2, 2015

LGTM

DarkDimius added a commit that referenced this pull request Jul 2, 2015
@DarkDimius DarkDimius merged commit 52b720a into scala:master Jul 2, 2015
@allanrenucci allanrenucci deleted the fix/#705-inner-value-class branch December 14, 2017 19:21
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.

4 participants