-
Notifications
You must be signed in to change notification settings - Fork 1.1k
dotty doesn't seem to take the full context into account when resolving implicits #13974
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
Comments
alternate minimization that's more self-contained (no object Test {
class C
class Use[A]
case class UseC() extends Use[C]
class ConversionTarget
implicit def convert(c: C): ConversionTarget = ???
def go[X](u: Use[X], x: X) =
u match {
case UseC() =>
x: ConversionTarget
}
} Scala 2.13.7, 2.12.15, 2.11.12, and 2.10.7 all compile this |
I've tried digging deeper into what's happening and working out a solution. Now Hence, any new information (e.g ones gained due to unification in pattern matching) won't be "seen" by I tried to test my intuition and introduced a small change that passed the current Unfortunately, that made some illegal programs to compile on the regression suite - particularly tests pertaining to ambiguous implicits - but that seemed to be salvageable by first testing for ambiguous implicits and only then trying to look for implicitis using the full current Right now, only What worries me, is that using the full |
Under a non-empty GADT constraint, bypass caches when computing eligible implicits. The GADT constraint might influence what implicits are available locally, so cached results would be unreliable. Fixes scala#13974
@bartosz-witkowski Thanks for the analysis., which helped to come up with the fix in #14072. |
Under a non-empty GADT constraint, bypass caches when computing eligible implicits. The GADT constraint might influence what implicits are available locally, so cached results would be unreliable. Fixes scala#13974
Under a non-empty GADT constraint, bypass caches when computing eligible implicits. The GADT constraint might influence what implicits are available locally, so cached results would be unreliable. Fixes scala#13974
Compiler version
3.1.0 (also tested on latest master
3.1.2-RC1-bin-SNAPSHOT-nonbootstrapped-git-2b37257
)Minimized code
Output
Expectation
Code compiles without errors.
The text was updated successfully, but these errors were encountered: