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

Support writing & instead of with in types under -Xsource:3 #9594

Merged
merged 1 commit into from Apr 27, 2021

Commits on Apr 25, 2021

  1. Support writing & instead of with in types under -Xsource:3

    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.
    smarter committed Apr 25, 2021
    Configuration menu
    Copy the full SHA
    98da259 View commit details
    Browse the repository at this point in the history