Skip to content

Extension method with default argument fails to construct #14278

Closed
@soronpo

Description

@soronpo

Compiler version

v3.1.1-RC2

Minimized code

https://scastie.scala-lang.org/MiSpvFT0SKygDNEJdezOzQ

class Foo

extension (foo : Foo)
  def patch(arg : List[Int], arg2 : Int = 0) : Unit = {}
  def patch(arg : Int) : Unit = patch(List(arg))

Output

value patch is not a member of Playground.Foo.
An extension method was tried, but could not be fully constructed:

    Playground.patch()

Expectation

No error.

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