File tree 3 files changed +30
-0
lines changed
src/dotty/tools/dotc/typer
3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,9 @@ object Checking {
105
105
}
106
106
107
107
def apply (tp : Type ) = tp match {
108
+ case tp : TermRef =>
109
+ this (tp.info)
110
+ mapOver(tp)
108
111
case tp @ RefinedType (parent, name) =>
109
112
val parent1 = this (parent)
110
113
val saved = cycleOK
Original file line number Diff line number Diff line change @@ -100,6 +100,8 @@ class tests extends CompilerTest {
100
100
@ Test def neg_badAuxConstr = compileFile(negDir, " badAuxConstr" , xerrors = 2 )
101
101
@ Test def neg_typetest = compileFile(negDir, " typetest" , xerrors = 1 )
102
102
@ Test def neg_t1569_failedAvoid = compileFile(negDir, " t1569-failedAvoid" , xerrors = 1 )
103
+ @ Test def neg_cycles = compileFile(negDir, " cycles" , xerrors = 6 )
104
+
103
105
@ Test def dotc = compileDir(dotcDir + " tools/dotc" , twice)(allowDeepSubtypes)
104
106
@ Test def dotc_ast = compileDir(dotcDir + " tools/dotc/ast" , twice)
105
107
@ Test def dotc_config = compileDir(dotcDir + " tools/dotc/config" , twice)
Original file line number Diff line number Diff line change @@ -2,3 +2,28 @@ class Foo[T <: U, U <: T]
2
2
3
3
class Bar [T >: T ]
4
4
5
+ class A {
6
+ val x : T = ???
7
+ type T <: x.type
8
+ }
9
+
10
+ class B {
11
+ type T <: x.type
12
+ val x : T = ???
13
+ }
14
+
15
+ class C {
16
+ val x : D # T = ???
17
+ class D {
18
+ type T <: x.type
19
+ val z : x.type = ???
20
+ }
21
+ }
22
+
23
+ class E {
24
+ class F {
25
+ type T <: x.type
26
+ val z : x.type = ???
27
+ }
28
+ val x : F # T = ???
29
+ }
You can’t perform that action at this time.
0 commit comments