forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Forward reference error includes line numbers
- Loading branch information
Showing
5 changed files
with
61 additions
and
35 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,24 @@ | ||
-- [E039] Reference Error: tests/neg/i14401.scala:6:17 ----------------------------------------------------------------- | ||
6 | def f: Int = x; // error | ||
| ^ | ||
| x is a forward reference extending over the definition of x (on L7) | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E039] Reference Error: tests/neg/i14401.scala:10:17 ---------------------------------------------------------------- | ||
10 | def f: Int = g; // error | ||
| ^ | ||
| g (defined on L12) is a forward reference extending over the definition of x (on L11) | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E039] Reference Error: tests/neg/i14401.scala:15:17 ---------------------------------------------------------------- | ||
15 | def f: Int = g; // error | ||
| ^ | ||
| g (defined on L17) is a forward reference extending over the definition of x (on L16) | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E039] Reference Error: tests/neg/i14401.scala:28:28 ---------------------------------------------------------------- | ||
28 | class NotUsed {val xs = args} // error | ||
| ^^^^ | ||
| args (defined on L31) is a forward reference extending over the definition of dummy (on L29) | ||
| | ||
| longer explanation available when compiling with `-explain` |
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,33 @@ | ||
object Test { | ||
def f: Int = x; | ||
val x: Int = f; | ||
|
||
{ | ||
def f: Int = x; // error | ||
val x: Int = f; | ||
} | ||
{ | ||
def f: Int = g; // error | ||
val x: Int = f; | ||
def g: Int = x; | ||
} | ||
{ | ||
def f: Int = g; // error | ||
var x: Int = f; | ||
def g: Int = x; | ||
} | ||
{ | ||
def f: Int = g; | ||
Console.println("foo"); | ||
def g: Int = f; | ||
} | ||
} | ||
|
||
object MyApp { | ||
def main(args: Array[String]) = { | ||
class NotUsed {val xs = args} // error | ||
val dummy = false | ||
// oops, shadows the parameter | ||
def args = Seq("a","b","c") | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.