Skip to content

Commit 1b0e2ed

Browse files
authored
Fix implicit scope liftToAnchors for parameter lower bounds (#23679)
Related to #23672 But we were dropping a lower bound in this case.
2 parents 64f8cfa + 6732630 commit 1b0e2ed

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
@@ -834,7 +834,7 @@ trait ImplicitRunInfo:
834834
WildcardType
835835
else
836836
seen += t
837-
t.superType match
837+
t.underlying match
838838
case TypeBounds(lo, hi) =>
839839
if lo.isBottomTypeAfterErasure then apply(hi)
840840
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)