Skip to content

Deprecate automatic () insertion #8035

Closed
@scabug

Description

@scabug

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions