File tree Expand file tree Collapse file tree 3 files changed +21
-2
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -1010,9 +1010,14 @@ class RefChecks extends MiniPhase { thisPhase =>
1010
1010
}
1011
1011
1012
1012
override def transformNew (tree : New )(implicit ctx : Context ) = {
1013
- val sym = tree.tpe.typeSymbol
1013
+ val tpe = tree.tpe
1014
+ val sym = tpe.typeSymbol
1014
1015
checkUndesiredProperties(sym, tree.pos)
1015
1016
currentLevel.enterReference(sym, tree.pos)
1017
+ tpe.dealias.foreachPart {
1018
+ case TermRef (_, s : Symbol ) => currentLevel.enterReference(s, tree.pos)
1019
+ case _ =>
1020
+ }
1016
1021
tree
1017
1022
}
1018
1023
}
@@ -1643,4 +1648,3 @@ class RefChecks extends MiniPhase { thisPhase =>
1643
1648
}
1644
1649
}
1645
1650
*/
1646
-
Original file line number Diff line number Diff line change
1
+ class I0 {
2
+ class I1
3
+ def i3 = {
4
+ val i4 = new i5.I1 // error: `i5` is a forward reference extending over the definition of `i4`
5
+ val i5 = new I0
6
+ }
7
+ }
Original file line number Diff line number Diff line change
1
+ class I0 {
2
+ class I1
3
+ def i3 = {
4
+ type T = i5.I1
5
+ val i4 = new T // error: `i5` is a forward reference extending over the definition of `i4`
6
+ val i5 = new I0
7
+ }
8
+ }
You can’t perform that action at this time.
0 commit comments