-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5178 from Jasper-M/fix/5044
Fix #5044: guard against forward references in the TypeTree of New trees
- Loading branch information
Showing
2 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
class I0 { | ||
class I1 | ||
def test0 = { | ||
val x = new y.I1 // error: `y` is a forward reference extending over the definition of `x` | ||
val y = new I0 | ||
} | ||
|
||
def test1 = { | ||
type T = y.I1 | ||
val x = new T // error: `y` is a forward reference extending over the definition of `x` | ||
val y = new I0 | ||
} | ||
|
||
class I2[T1, T2] | ||
def test2 = { | ||
type A[T] = y.I2[T, String] | ||
val x = new A[Int] // error: `y` is a forward reference extending over the definition of `x` | ||
val y = new I0 | ||
} | ||
|
||
def test3 = { | ||
val x = new T // error: `T` is a forward reference extending over the definition of `x` | ||
val y = new I0 | ||
type T = y.I1 | ||
} | ||
} |