Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: Scala 2.11.0-M7
    • Fix Version/s: Scala 2.11.0-M8
    • Component/s: Misc Compiler
    • 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

        Issue Links

          Activity

          Hide
          Jason Zaugg added a comment -

          I think we should consider this as part of a holistic plan to deprecate autotupling in cases when the expected type was not TupleN.

          Show
          Jason Zaugg added a comment - I think we should consider this as part of a holistic plan to deprecate autotupling in cases when the expected type was not TupleN.
          Hide
          Seth Tisue added a comment -

          Man. It'd be super great if this finally got addressed.

          Show
          Seth Tisue added a comment - Man. It'd be super great if this finally got addressed.
          Show
          Simon Ochsenreither added a comment - PR: https://github.com/scala/scala/pull/3260

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development