-
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.
Backport "Better error messages for missing commas and more" to LTS (#…
- Loading branch information
Showing
18 changed files
with
174 additions
and
87 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
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
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,17 +1,4 @@ | ||
-- [E018] Syntax Error: tests/neg/i14564.scala:5:28 -------------------------------------------------------------------- | ||
5 |def test = sum"${ List(42)* }" // error // error | ||
| ^ | ||
| expression expected but [31m'}'[0m found | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E008] Not Found Error: tests/neg/i14564.scala:5:26 ----------------------------------------------------------------- | ||
5 |def test = sum"${ List(42)* }" // error // error | ||
| ^^^^^^^^^ | ||
| value * is not a member of List[Int], but could be made available as an extension method. | ||
| | ||
| One of the following imports might make progress towards fixing the problem: | ||
| | ||
| import scala.math.Fractional.Implicits.infixFractionalOps | ||
| import scala.math.Integral.Implicits.infixIntegralOps | ||
| import scala.math.Numeric.Implicits.infixNumericOps | ||
| | ||
-- Error: tests/neg/i14564.scala:5:26 ---------------------------------------------------------------------------------- | ||
5 |def test = sum"${ List(42)* }" // error | ||
| ^ | ||
| spread operator `*` not allowed here; must come last in a parameter list |
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,28 @@ | ||
-- [E040] Syntax Error: tests/neg/i18734.scala:7:8 --------------------------------------------------------------------- | ||
7 | Foo(1 2) // error | ||
| ^ | ||
| ',' or ')' expected, but integer literal found | ||
-- [E040] Syntax Error: tests/neg/i18734.scala:9:8 --------------------------------------------------------------------- | ||
9 | Foo(x y) // error | ||
| ^ | ||
| ',' or ')' expected, but identifier found | ||
-- [E040] Syntax Error: tests/neg/i18734.scala:11:8 -------------------------------------------------------------------- | ||
11 | Foo(1 b = 2) // error | ||
| ^ | ||
| ',' or ')' expected, but identifier found | ||
-- [E040] Syntax Error: tests/neg/i18734.scala:16:4 -------------------------------------------------------------------- | ||
16 | b = 2 // error | ||
| ^ | ||
| ',' or ')' expected, but identifier found | ||
-- [E040] Syntax Error: tests/neg/i18734.scala:19:32 ------------------------------------------------------------------- | ||
19 | val f: (Int, Int) => Int = (x y) => x + y // error | ||
| ^ | ||
| ',' or ')' expected, but identifier found | ||
-- [E040] Syntax Error: tests/neg/i18734.scala:23:10 ------------------------------------------------------------------- | ||
23 | bar[Int String](1 2) // error // error | ||
| ^^^^^^ | ||
| ',' or ']' expected, but identifier found | ||
-- [E040] Syntax Error: tests/neg/i18734.scala:23:20 ------------------------------------------------------------------- | ||
23 | bar[Int String](1 2) // error // error | ||
| ^ | ||
| ',' or ')' expected, but integer literal 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,25 @@ | ||
case class Foo(a: Int, b: Int) | ||
|
||
object Bar: | ||
val x = 1 | ||
val y = 2 | ||
|
||
Foo(1 2) // error | ||
|
||
Foo(x y) // error | ||
|
||
Foo(1 b = 2) // error | ||
|
||
// Or | ||
Foo( | ||
a = 1 | ||
b = 2 // error | ||
) | ||
|
||
val f: (Int, Int) => Int = (x y) => x + y // error | ||
|
||
def bar[X, Y](x: X, y: Y) = ??? | ||
|
||
bar[Int String](1 2) // 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,2 +1,2 @@ | ||
class x0 { var x0 == _ * // error: _* can be used only for last argument // error: == cannot be used as an extractor in a pattern because it lacks an unapply or unapplySeq method | ||
// error '=' expected, but eof found | ||
class x0 { var x0 == _ * // error spread operator `*` not allowed here // error '=' expected | ||
// error: == cannot be used as an extractor in a pattern because it lacks an unapply or unapplySeq method |
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
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,3 +1,3 @@ | ||
def I0(I1: Int ) = I1 | ||
val I1 = I0(I0 i2) => // error | ||
val I1 = I0(I0 i2) => // error // error | ||
true |
Oops, something went wrong.