-
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.
added check for repeated params in using clause
refactor and more tests Update error message Co-authored-by: Nicolas Stucki <[email protected]> fix error code
- Loading branch information
Showing
5 changed files
with
65 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
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,42 @@ | ||
-- [E188] Syntax Error: tests/neg/i18090.scala:2:18 -------------------------------------------------------------------- | ||
2 |def foo(using xs: Int*) = xs // error | ||
| ^^^^ | ||
| repeated parameters are not allowed in a using clause | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E188] Syntax Error: tests/neg/i18090.scala:3:27 -------------------------------------------------------------------- | ||
3 |def foo5(using d: Int, xs: Int*) = xs // error | ||
| ^^^^ | ||
| repeated parameters are not allowed in a using clause | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E188] Syntax Error: tests/neg/i18090.scala:4:22 -------------------------------------------------------------------- | ||
4 |def foo2(implicit xs: Int*) = xs // error | ||
| ^^^^ | ||
| repeated parameters are not allowed in a implicit clause | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E188] Syntax Error: tests/neg/i18090.scala:5:35 -------------------------------------------------------------------- | ||
5 |def foo3(u: Int)(using d: Int, xs: Int*) = xs // error | ||
| ^^^^ | ||
| repeated parameters are not allowed in a using clause | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E188] Syntax Error: tests/neg/i18090.scala:6:38 -------------------------------------------------------------------- | ||
6 |def foo4(u: Int)(implicit d: Int, xs: Int*) = xs // error | ||
| ^^^^ | ||
| repeated parameters are not allowed in a implicit clause | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E188] Syntax Error: tests/neg/i18090.scala:9:20 -------------------------------------------------------------------- | ||
9 | def bar(using xs: Float*) = ??? // error | ||
| ^^^^^^ | ||
| repeated parameters are not allowed in a using clause | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E188] Syntax Error: tests/neg/i18090.scala:10:33 ------------------------------------------------------------------- | ||
10 | def bar2(using d: Boolean, xs: Float*) = ??? // error | ||
| ^^^^^^ | ||
| repeated parameters are not allowed in a using clause | ||
| | ||
| 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,10 @@ | ||
|
||
def foo(using xs: Int*) = xs // error | ||
def foo5(using d: Int, xs: Int*) = xs // error | ||
def foo2(implicit xs: Int*) = xs // error | ||
def foo3(u: Int)(using d: Int, xs: Int*) = xs // error | ||
def foo4(u: Int)(implicit d: Int, xs: Int*) = xs // error | ||
|
||
extension (i: Int) | ||
def bar(using xs: Float*) = ??? // error | ||
def bar2(using d: Boolean, xs: Float*) = ??? // error |