Skip to content

Default arguments lost when overloading methods with type parameters #14096

@cornerman

Description

@cornerman

Compiler version

3.1.0

Minimized code

object Forte {
     // the generic type parameters are required to trigger the error, without it works just fine.
     def test[T](i:Int, config: String = ""): Int = 1
     def test[T](i:String): Int = 2
}

Forte.test[Int](1)

Output

-- Error:
1 |Forte.test[Int](1)
  |^^^^^^^^^^
  |None of the overloaded alternatives of method test in object Forte with types
  | [T](i: String): Int
  | [T](i: Int, config: String): Int
  |match type arguments [Int] and arguments ((1 : Int))

Expectation

This should compile, like in 2.13 and 2.12.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions