-
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
Default implicit not enabled for outer object if it is not a singleton #12952
Comments
wondering if there is an easy fix in Scala 2 |
When opening a ticket in scala/bug, please don't just offer code that doesn't compile; you are expected to make a case that this is a bug in Scala 2. Make arguments; link to related tickets; provide evidence that your minimization is actually minimal; consider quoting relevant spec language. If you feel you don't have the time or energy for that and just want to ask your question, please use https://users.scala-lang.org instead of the bug tracker. |
☑️ compiles in dotty The implicit is available via the prefix of (Note: these are not local types, which is a traditional heel of Achilles.) |
Minimized a bit to remove distracting extra code: trait Case[T]
trait Outer {
case class A(v: String)
implicit def caseA: Case[A] = ???
}
def fn(o: Outer) =
implicitly[Case[o.A]] |
As an example of what I mean by citing relevant documentation before filing a bug report, is there anything relevant in https://docs.scala-lang.org/scala3/reference/changed-features/implicit-resolution.html ...? If you looked carefully and you became convinced that there isn't, say so in your report. |
☑️ The important change is that packages in the prefix no longer contribute; that was lrytz's recent warning.
Not sure if "fix" means "workaround" or "fix that might make it into 2.13.14". |
I guess you mean scala/scala#10621 ? I haven't looked closely at it, but the title implies it's specific to package prefixes, but here the prefix |
Yes, I intended to say that the significant change does not apply to this case. |
@SethTisue you are right they are different. The prefix For the others, I'll try to revise all the tickets in the past (and re-open them if necessary) |
thanks. and yes, any closing of tickets is only provisional |
I think the relevant difference in the spec is: Scala 3
Scala2
"Parts of the type of p" include e.g. |
Reproduction steps
Scala version: 2.13.12
Problem
Compiles in Scala 3 (tested 3.4-SNAPSHOT)
Failed in Scala 2:
The text was updated successfully, but these errors were encountered: