Skip to content

Fix #4496: call ensureAccessible to bypass class-level accessibility #4529

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 1 commit into from
May 28, 2018

Conversation

Blaisorblade
Copy link
Contributor

Fix #4496. Writing this test led to #4528.

trait Foo3 { var a: Int }

object TestStructuralVar {
type T0 = {var a: Int} // error
Copy link
Member

Choose a reason for hiding this comment

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

Unrelated, but maybe this should be allowed and given the same semantics as having a getter/setter ?

Copy link
Member

@smarter smarter May 14, 2018

Choose a reason for hiding this comment

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

On second thoughts, maybe that's not worth it, since then it needs to be meaningful for all possible interpretations of structural types, nevermind.

Copy link
Member

Choose a reason for hiding this comment

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

...but maybe the error message could suggest replacing the var by a val and a setter.

@allanrenucci allanrenucci merged commit 2e4487f into scala:master May 28, 2018
@allanrenucci allanrenucci deleted the fix-4496-part2 branch May 28, 2018 14:05
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