Skip to content

named arguments can't be used for implicit extension method if original type has same-named method #7809

Open
@scabug

Description

@scabug
class A {
  def a(s: String) {}
}

object O {
  implicit class B(val a: A) {
    def a(i: Int) {}
    def b(i: Int) {}
  }
}

import O._

new A().a("")    // works
new A().a(1)     // works
new A().b(i = 1) // works
new A().a(i = 1) // does not work

The last line gives the following error message (Scala 2.10.2):
<console>:25: error: not found: value i
              new A().a(i = 1) // does not work

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions