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

avoid infix with _*. prepare Scala 3 #11325

Merged
merged 1 commit into from
Jun 14, 2022

Commits on Jun 13, 2022

  1. avoid infix with _*. prepare Scala 3

    https://github.com/playframework/playframework/blob/6e614d11cca8070e6c3aa4940f682f8cc1183e73/core/play/src/main/scala/play/api/libs/typedmap/TypedMap.scala#L94
    
    ```
    [error] 99 |    withAttrs(attrs + (entries: _*))
    [error]    |                                ^
    [error]    |          `_*` can be used only for last argument of method application.
    [error]    |          It is no longer allowed in operands of infix operations.
    ```
    
    ```
    Welcome to Scala 3.1.2 (11.0.15, Java OpenJDK 64-Bit Server VM).
    Type in expressions for evaluation. Or try :help.
    
    scala> object A { def +(xs: Int*): Unit = () }
    // defined object A
    
    scala> def a(xs: Int*) = A + (xs: _*)
    -- Error: ----------------------------------------------------------------------
    1 |def a(xs: Int*) = A + (xs: _*)
      |                           ^
      |            `_*` can be used only for last argument of method application.
      |            It is no longer allowed in operands of infix operations.
    
    scala> def a(xs: Int*) = A.+(xs: _*)
    def a(xs: Int*): Unit
    ```
    xuwei-k committed Jun 13, 2022
    Configuration menu
    Copy the full SHA
    a02656f View commit details
    Browse the repository at this point in the history