Skip to content

Fail to compile repeated arguments with named parameter #3207

@allanrenucci

Description

@allanrenucci

The following code snippet does not compile

class Test {
  def foo(ff: String*) = 1
  def bar(bb: String*) = foo(ff = bb: _*)
}
-- [E007] Type Mismatch Error: tests/allan/Test.scala:3:34 ---------------------
3 |  def bar(bb: String*) = foo(ff = bb: _*)
  |                                  ^^
  |                                  found:    String*
  |                                  required: String
  |                                  

one error found

It compiles with bar defined as:

def bar(bb: String*) = foo(bb: _*)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions