Details

    • Type: Bug
    • Status: CLOSED
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Scala 2.11.0-M7
    • Fix Version/s: Scala 2.11.0-M8
    • Component/s: Compiler (Misc)
    • Labels:
      None

      Description

      While trying to bridge the gap between tuples and parameter lists, the compiler is a bit too eager to insert 0-Tuples () into argument lists.

      This is pretty much never what a developer wants (and we couldn't come up with a single example where the () insertion is “a good thing” in three months), but has been the cause of a lot of embarrassing behavior:

      scala> List(1,2,3).toSet()
      res0: Boolean = false
      

      import java.text.SimpleDateFormat
      val sdf = new SimpleDateFormat("yyyyMMdd-HH0000")
      sdf.format()
      java.lang.IllegalArgumentException: Cannot format given Object as a Date
        at java.text.DateFormat.format(DateFormat.java:301)
        at java.text.Format.format(Format.java:157)
        ...
      

      scala> class A[T](val x: T)
      defined class A
       
      scala> new A
      res0: A[Unit] = A@5534578f
      

      Mailing list threads:

      https://groups.google.com/forum/#!topic/scala-internals/4RMEZGObPm4
      https://groups.google.com/forum/#!topic/scala-user/4yggJc38tIg/discussion
      https://groups.google.com/forum/#!topic/scala-debate/zwG8o2YzCWs

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                soc Simon Ochsenreither
                Reporter:
                soc Simon Ochsenreither
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: