Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bypass eligible caches for implicit search under GADT constraints
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 #13974
- Loading branch information
Showing
5 changed files
with
53 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
object Test2: | ||
class Foo[+X] | ||
enum SUB[-S, +T]: | ||
case Refl[U]() extends SUB[U, U] | ||
def f[A, B, C](sub : A SUB (B,C)) = | ||
given Foo[A] = ??? | ||
val x = summon[Foo[A]] | ||
sub match | ||
case SUB.Refl() => | ||
val c: Foo[(B, C)] = summon[Foo[A]] | ||
summon[Foo[(B, C)]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
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() => | ||
//val y: C = x | ||
x: ConversionTarget | ||
} | ||
} |