Skip to content

Commit 6732630

Browse files
Fix implicit scope liftToAnchors for parameter lower bounds
Related to #23672 (comment) But we were dropping a lower bound in this case.
1 parent 53bea78 commit 6732630

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
@@ -832,7 +832,7 @@ trait ImplicitRunInfo:
832832
WildcardType
833833
else
834834
seen += t
835-
t.superType match
835+
t.underlying match
836836
case TypeBounds(lo, hi) =>
837837
if lo.isBottomTypeAfterErasure then apply(hi)
838838
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)