Scala Programming Language
  1. Scala Programming Language
  2. SI-7299

Misleading error message when trying to eta-expand method with more than 22 parameters

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: Scala 2.10.0
    • Fix Version/s: Scala 2.10.2-RC1
    • Component/s: None

      Description

      An attempt to eta-expand a method with more than 22 parameters fails as expected (because there is no corresponding FunctionXY class) but the error message is misleading:

      $ scala
      Welcome to Scala version 2.10.0 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_15).
      Type in expressions to have them evaluated.
      Type :help for more information.
      
      scala> def f(a1: Int, a2: Int, a3: Int, a4: Int, a5: Int, a6: Int, a7: Int, a8: Int, a9: Int, a10: Int, a11: Int, a12: Int, a13: Int, a14: Int, a15: Int, a16: Int, a17: Int, a18: Int, a19: Int, a20: Int, a21: Int, a22: Int, a23: Int) = 0
      f: (a1: Int, a2: Int, a3: Int, a4: Int, a5: Int, a6: Int, a7: Int, a8: Int, a9: Int, a10: Int, a11: Int, a12: Int, a13: Int, a14: Int, a15: Int, a16: Int, a17: Int, a18: Int, a19: Int, a20: Int, a21: Int, a22: Int, a23: Int)Int
      
      scala> (f _)
      <console>:9: error: missing arguments for method f;
      follow this method with `_' if you want to treat it as a partially applied function
                    (f _)
                     ^
      

        Activity

        Show
        Jason Zaugg added a comment - https://github.com/scala/scala/pull/2306

          People

          • Assignee:
            Jason Zaugg
            Reporter:
            Stefan Zeiger
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development