Skip to content

Commit 8bd2916

Browse files
EugeneFlesselletgodzik
authored andcommitted
Fix implicit scope liftToAnchors for parameter lower bounds
Related to scala#23672 (comment) But we were dropping a lower bound in this case. [Cherry-picked 6732630]
1 parent 3100c7e commit 8bd2916

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Implicits.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ trait ImplicitRunInfo:
790790
WildcardType
791791
else
792792
seen += t
793-
t.superType match
793+
t.underlying match
794794
case TypeBounds(lo, hi) =>
795795
if lo.isBottomTypeAfterErasure then apply(hi)
796796
else AndType.make(apply(lo), apply(hi))

tests/pos/i21951b.scala

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
class A
3+
object A:
4+
given A = ???
5+
6+
class B[X]
7+
object B:
8+
given g[T]: B[T] = ???
9+
10+
object Test:
11+
def foo[X >: A] = summon[X] // was error
12+
def bar[F[T] >: B[T]] = summon[F[Int]] // was error

0 commit comments

Comments
 (0)