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

implicit search should resolve ambiguities by fully resolving transitively required implicit arguments #3340

Closed
scabug opened this issue Apr 22, 2010 · 4 comments
Milestone

Comments

@scabug
Copy link

scabug commented Apr 22, 2010

this came up in the context of Liszt:

object Test {
  class Foo(x: Meh) { def foo(a: String) = 1 }
  class Meh
  class A
  implicit object a extends A
  class B
  // implicit object b extends B
  
  implicit def mkFooA(x: Meh)(implicit w: A) : Foo = new Foo(x)
  implicit def mkFooB(x: Meh)(implicit w: B) : Foo = new Foo(x)

  (new Meh).foo("1")
}

there should be no ambiguities as mkFooB requires an implicit value of type B, which is not available

@scabug
Copy link
Author

scabug commented Apr 22, 2010

Imported From: https://issues.scala-lang.org/browse/SI-3340?orig=1
Reporter: @adriaanm

@scabug
Copy link
Author

scabug commented Apr 22, 2010

@adriaanm said:
(In r21656) see #3340: tentative fix to resolve ambiguities by chasing transitively required implicits

@scabug
Copy link
Author

scabug commented Apr 22, 2010

@retronym said:
Cool! We've worked around this limitation Scalaz, by splitting scalaz.MA into scalaz.MA / scalaz.MACofunctor.

#2781 is of the same ilk. Are you passing type constraints, too? I mean, they basically like extra implicit params of type <:<[A, B].

@joroKr21
Copy link
Member

This works but implicit conversions are on the way out.

@scala scala deleted a comment from scabug Dec 30, 2019
@SethTisue SethTisue modified the milestones: Backlog, 2.11.0 Dec 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants