Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nicolasstucki opened this issue Feb 4, 2020 · 0 comments · May be fixed by #8245
Open

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

nicolasstucki opened this issue Feb 4, 2020 · 0 comments · May be fixed by #8245
Assignees

Comments

@nicolasstucki
Copy link
Contributor

@nicolasstucki nicolasstucki commented Feb 4, 2020

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

nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Feb 4, 2020
Workaround lampepfl#8188 by renaming on of the `show` to `showWith`
@anatoliykmetyuk anatoliykmetyuk self-assigned this Feb 4, 2020
anatoliykmetyuk added a commit to dotty-staging/dotty that referenced this issue Feb 7, 2020
anatoliykmetyuk added a commit to dotty-staging/dotty that referenced this issue Feb 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.