-
Notifications
You must be signed in to change notification settings - Fork 21
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
Context-bounded implicit defs sometimes fail to work #7609
Comments
Imported From: https://issues.scala-lang.org/browse/SI-7609?orig=1 |
@xeno-by said: |
Régis Jean-Gilles (rjean-gilles) said: If one tries to fix the issue by resorting on macros (by doing something along the lines of And of importance is the fact that when trying this macro implementation, one can see that the target type As a side note, Roman Janusz initially reported the issue on the scala-user group, and he too noticed the problem with the target type being inferred as "Nothing": https://groups.google.com/forum/#!topic/scala-user/3fXswCh7Xz8 Is there any plan to work on this issue in the forseable future? |
Régis Jean-Gilles (rjean-gilles) said: The type class pattern has become ubiquitous for a good reason, and implicit conversions are also an important feature of scala. It is only natural to want to combine both features by totally offloading the implementation of an implicit conversion to a type class. |
@ghik said: |
@xeno-by said: class Test {
trait Foo[T, U]
object Foo { implicit def foo: Foo[String, Int] = new Foo[String, Int]{} }
implicit def conv[T, U](s: T)(implicit foo: Foo[T, U]): U = ???
def foo(c: Int) = ???
foo("")
} This, however, requires a fix to #3346, which is a pull request currently under review: scala/scala#2822. If you're interested in having this bugfix in 2.11 and have some spare time, I can elaborate on how you can help. |
Régis Jean-Gilles (rjean-gilles) said: I am definitly interested in seeing this bugfix in 2.11. |
Régis Jean-Gilles (rjean-gilles) said: |
@xeno-by said: |
is this still relevant? should this stay open? |
I think it is. Let's keep this open. The workaround mentioned here works now, which on the one hand makes this less urgent, but on the other is confirmation that this is a bug and fixable. |
The text was updated successfully, but these errors were encountered: