Skip to content

overloaded alternative of varargs method invoke-blocks intended target if Nothing is inferred #5859

@scabug

Description

@scabug


scala> def f(xs: List[Int], ys: AnyRef*) = () ; def f(xs: AnyRef*) = ()
f: (xs: List[Int], ys: AnyRef*)Unit <and> (xs: AnyRef*)Unit
f: (xs: List[Int], ys: AnyRef*)Unit <and> (xs: AnyRef*)Unit

scala> f()

scala> f(Nil: _*)
<console>:9: error: no `: _*' annotation allowed here
(such annotations are only allowed in arguments to *-parameters)
              f(Nil: _*)
                   ^

scala> f((Nil: List[String]): _*)

scala> f(Array(): _*)
<console>:9: error: no `: _*' annotation allowed here
(such annotations are only allowed in arguments to *-parameters)
              f(Array(): _*)
                       ^

scala> f(Array[String](): _*)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions