forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 17
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 scala#13442 from som-snytt/issue/13440
Avoid shadowing of name 'name'
- Loading branch information
Showing
3 changed files
with
33 additions
and
24 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 |
---|---|---|
@@ -1,4 +1,12 @@ | ||
-- Error: tests/neg-custom-args/fatal-warnings/i13440.scala:3:13 ------------------------------------------------------- | ||
3 |case class A(enum: List[Int] = Nil) // error | ||
-- Error: tests/neg-custom-args/fatal-warnings/i13440.scala:3:4 -------------------------------------------------------- | ||
3 |def given = 42 // error | ||
| ^ | ||
| given is now a keyword, write `given` instead of given to keep it as an identifier | ||
-- Error: tests/neg-custom-args/fatal-warnings/i13440.scala:5:13 ------------------------------------------------------- | ||
5 |case class C(enum: List[Int] = Nil) { // error | ||
| ^ | ||
| enum is now a keyword, write `enum` instead of enum to keep it as an identifier | ||
-- Error: tests/neg-custom-args/fatal-warnings/i13440.scala:6:11 ------------------------------------------------------- | ||
6 | val s = s"$enum" // error | ||
| ^ | ||
| enum is now a keyword, write `enum` instead of enum to keep it as an identifier |
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,7 @@ | ||
import language.`3.0-migration` | ||
|
||
case class A(enum: List[Int] = Nil) // error | ||
def given = 42 // error | ||
|
||
case class C(enum: List[Int] = Nil) { // error | ||
val s = s"$enum" // error | ||
} |