Skip to content

Commit 46b7fc7

Browse files
committed
Merge pull request #1107 from dotty-staging/fix/wildApprox-lazyref
ProtoTypes#wildApprox: fix LazyRef approximation
2 parents 8543d46 + 48cd101 commit 46b7fc7

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/dotty/tools/dotc/typer/ProtoTypes.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,8 @@ object ProtoTypes {
420420
WildcardType(tp1a.bounds | tp2a.bounds)
421421
else
422422
tp.derivedOrType(tp1a, tp2a)
423+
case tp: LazyRef =>
424+
WildcardType
423425
case tp: SelectionProto =>
424426
tp.derivedSelectionProto(tp.name, wildApprox(tp.memberProto), NoViewsAllowed)
425427
case tp: ViewProto =>

tests/pos/i1103.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class Sys[S]
2+
class Foo[T <: Sys[T]] {
3+
val t: T = ???
4+
def foo[A <: Sys[A]](x: A = t) = x
5+
}

0 commit comments

Comments
 (0)