Skip to content

Commit ba0aff8

Browse files
committed
Test case and fix typos
1 parent 7d87761 commit ba0aff8

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3024,7 +3024,7 @@ object Types {
30243024
tp.superType.applyIfParameterized(args)
30253025
case _ => defn.AnyType
30263026
}
3027-
validSuper = ctx.period
3027+
if (canCache) validSuper = ctx.period
30283028
}
30293029
cachedSuper
30303030
}

tests/pos/i2888.scala

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
trait Foo[A, CC[X] <: Foo[X, CC, CC[X]], C <: CC[A]] {
2+
3+
def cc: CC[A]
4+
5+
def foo: Unit = ()
6+
7+
def bar: Unit = cc.foo
8+
9+
}
10+
11+
object Main {
12+
def main(args: Array[String]): Unit = ()
13+
}

0 commit comments

Comments
 (0)