Skip to content

Overloaded extension methods with context parameters cannot be fully constructed #8188

Closed
@nicolasstucki

Description

@nicolasstucki

minimized code

object Test {
  extension StrDeco on (tree: String) {
    def show(given DummyImplicit): String = ???
    def show(color: Boolean)(given DummyImplicit): String = ???
  }

  val a: String = "foo".show
  val b: String = "foo".show(true)
  val c: Any = "foo".show
  val d: Any = "foo".show(true)
}

Compilation output

11 |  val c: Any = "foo".show
   |               ^^^^^^^^^^
   |      value show is not a member of String.
   |      An extension method was tried, but could not be fully constructed:
   |
   |          Test.StrDeco.show("foo")

expectation

It should compile

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions