-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better error recovery in comma-separated lists
- Loading branch information
Showing
4 changed files
with
88 additions
and
29 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,36 @@ | ||
-- [E040] Syntax Error: tests/neg/comma-separated-errors.scala:3:21 ---------------------------------------------------- | ||
3 | def foo(x: Int = 5 6, y Int = 7, z: Int 5, x = 5): Unit = () // error // error // error // error | ||
| ^ | ||
| ')' expected, but integer literal found | ||
-- [E040] Syntax Error: tests/neg/comma-separated-errors.scala:3:26 ---------------------------------------------------- | ||
3 | def foo(x: Int = 5 6, y Int = 7, z: Int 5, x = 5): Unit = () // error // error // error // error | ||
| ^^^ | ||
| ':' expected, but identifier found | ||
-- [E040] Syntax Error: tests/neg/comma-separated-errors.scala:3:42 ---------------------------------------------------- | ||
3 | def foo(x: Int = 5 6, y Int = 7, z: Int 5, x = 5): Unit = () // error // error // error // error | ||
| ^ | ||
| ')' expected, but integer literal found | ||
-- [E040] Syntax Error: tests/neg/comma-separated-errors.scala:3:47 ---------------------------------------------------- | ||
3 | def foo(x: Int = 5 6, y Int = 7, z: Int 5, x = 5): Unit = () // error // error // error // error | ||
| ^ | ||
| ':' expected, but '=' found | ||
-- [E040] Syntax Error: tests/neg/comma-separated-errors.scala:11:16 --------------------------------------------------- | ||
11 | case Plus(4 1) => // error | ||
| ^ | ||
| ')' expected, but integer literal found | ||
-- [E040] Syntax Error: tests/neg/comma-separated-errors.scala:12:16 --------------------------------------------------- | ||
12 | case Plus(4 5 6 7, 1, 2 3) => // error // error | ||
| ^ | ||
| ')' expected, but integer literal found | ||
-- [E040] Syntax Error: tests/neg/comma-separated-errors.scala:12:28 --------------------------------------------------- | ||
12 | case Plus(4 5 6 7, 1, 2 3) => // error // error | ||
| ^ | ||
| ')' expected, but integer literal found | ||
-- [E040] Syntax Error: tests/neg/comma-separated-errors.scala:14:12 --------------------------------------------------- | ||
14 | val x: A[T=Int, T=Int] = ??? // error // error | ||
| ^ | ||
| ']' expected, but '=' found | ||
-- [E040] Syntax Error: tests/neg/comma-separated-errors.scala:14:19 --------------------------------------------------- | ||
14 | val x: A[T=Int, T=Int] = ??? // error // error | ||
| ^ | ||
| ']' expected, but '=' found |
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,15 @@ | ||
class A[T] | ||
object o { | ||
def foo(x: Int = 5 6, y Int = 7, z: Int 5, x = 5): Unit = () // error // error // error // error | ||
|
||
case class Plus(a: Int, b: Int) | ||
|
||
object Plus { | ||
def unapply(r: Int): Plus = Plus(r - 1, 1) | ||
} | ||
5 match { | ||
case Plus(4 1) => // error | ||
case Plus(4 5 6 7, 1, 2 3) => // error // error | ||
} | ||
val x: A[T=Int, T=Int] = ??? // error // error | ||
} |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
class A[T] | ||
object o { | ||
// Testing compiler crash, this test should be modified when named type argument are completely implemented | ||
val x: A[T=Int, T=Int] = ??? // error: ']' expected, but '=' found // error | ||
val x: A[T=Int, T=Int] = ??? // error: ']' expected, but '=' found // error: ']' expected, but '=' found | ||
} |