Skip to content

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