-
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.
- Loading branch information
1 parent
1009b9a
commit 48f3f87
Showing
4 changed files
with
19 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
-- Warning: tests/neg/i11118-pre3-4.scala:4:12 ------------------------------------------------------------------------- | ||
4 |val (a,b) = (1,2,3) // error // warning | ||
| ^^^^^^^ | ||
| pattern's type (Any, Any) does not match the right hand side expression's type (Int, Int, Int) | ||
| | ||
| If the narrowing is intentional, this can be communicated by adding `: @unchecked` after the expression, | ||
| which may result in a MatchError at runtime. | ||
| This patch can be rewritten automatically under -rewrite -source 3.2-migration. | ||
-- Error: tests/neg/i11118-pre3-4.scala:4:4 ---------------------------------------------------------------------------- | ||
4 |val (a,b) = (1,2,3) // error // warning | ||
| ^ | ||
| this case is unreachable since type (Int, Int, Int) is not a subclass of class Tuple2 |
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,4 @@ | ||
import scala.language.`3.3` | ||
|
||
// https://github.com/lampepfl/dotty/issues/11118 | ||
val (a,b) = (1,2,3) // error // warning |
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,12 +1,8 @@ | ||
-- Warning: tests/neg/i11118.scala:2:12 -------------------------------------------------------------------------------- | ||
2 |val (a,b) = (1,2,3) // error // warning | ||
-- Error: tests/neg/i11118.scala:2:12 ---------------------------------------------------------------------------------- | ||
2 |val (a,b) = (1,2,3) // error | ||
| ^^^^^^^ | ||
| pattern's type (Any, Any) does not match the right hand side expression's type (Int, Int, Int) | ||
| | ||
| If the narrowing is intentional, this can be communicated by adding `: @unchecked` after the expression, | ||
| which may result in a MatchError at runtime. | ||
| This patch can be rewritten automatically under -rewrite -source 3.2-migration. | ||
-- Error: tests/neg/i11118.scala:2:4 ----------------------------------------------------------------------------------- | ||
2 |val (a,b) = (1,2,3) // error // warning | ||
| ^ | ||
| this case is unreachable since type (Int, Int, Int) is not a subclass of class Tuple2 |
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 @@ | ||
// https://github.com/lampepfl/dotty/issues/11118 | ||
val (a,b) = (1,2,3) // error // warning | ||
val (a,b) = (1,2,3) // error |