Skip to content

Overload resolution for extension methods fails in some cases where named parameters are involved. #15287

Closed
@rmgk

Description

@rmgk

Compiler version

3.1.3-RC3, 3.2.0-RC1-bin-20220519-ee9cc8f-NIGHTLY-git-ee9cc8f

Minimized code

extension (x: Char)
  def f(someParam: String): String = "a"
  def f(min: Boolean, max: Int = 4): String = "b"

@main def run() = 'c'.f(false)

Output

Test.scala:7:19: value f is not a member of Char.
An extension method was tried, but could not be fully constructed:

    extensionOverload.f()    failed with

        value f: <overloaded extensionOverload.f> does not take parameters [7:19]

Expectation

Compile just fine, return "b"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions