Skip to content

Allow , in parents of template #5518

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

Closed
wants to merge 1 commit into from
Closed

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Nov 26, 2018

New syntax

A extends B, C { ... }

instead of

A extends B with C { ... }

The old syntax is still allowed, but it's planned to phase it out together
with with as a type operator.

Also: disallow

A extends { ... }

(make it a migration warning under -language:Scala2)

While doing these changes, applied some refactorings to handle templates
in the parser which hopefully make the code clearer.

(This is all in preparation for adding derives clauses.)

@sjrd
Copy link
Member

sjrd commented Nov 26, 2018

What becomes of new A with B {}?

New syntax

    A extends B, C { ... }

instead of

    A extends B with C { ... }

The old syntax is still allowed, but it's planned to phase it out together
with `with` as a type operator.

Also: disallow

    A extends { ... }

(make it a migration warning under -language:Scala2)

While doing these changes, applied some refactorings to handle templates
in the parser which hopefully make the code clearer.
@odersky
Copy link
Contributor Author

odersky commented Nov 26, 2018

new A with B {}?

I'd have a tendency to phase that out (in 3.1+). Replace it with a named class.

@odersky
Copy link
Contributor Author

odersky commented Dec 10, 2018

It's part of #5540, where it can be discussed in context

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.

2 participants