Skip to content
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

[backport] Support writing & instead of with in types under -Xsource:3 #9595

Merged
merged 1 commit into from Apr 27, 2021

Conversation

smarter
Copy link
Member

@smarter smarter commented Apr 25, 2021

This backports #9594 (which has not been accepted yet).

@scala-jenkins scala-jenkins added this to the 2.12.14 milestone Apr 25, 2021
Instead of:

    val x: A with B = new A with B {}

One can now write:

    val x: A & B = new A with B {}

However mixing `&` with other infix operators is not allowed, because
unlike Scala 3, we do not take operator precedence into account, cf scala#6147.

This implementation is a bit more restrictive than the Scala 3 one which
allows shadowing the built-in `&` with your own `&` type operator, but
this cannot be done with the simple parser-based approach of this PR.
@lrytz lrytz merged commit 7e23749 into scala:2.12.x Apr 27, 2021
@SethTisue SethTisue added the release-notes worth highlighting in next release notes label Apr 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes worth highlighting in next release notes
Projects
None yet
4 participants