forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
And check it with a pos checkfile.
- Loading branch information
Showing
15 changed files
with
148 additions
and
65 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,20 @@ | ||
-- [E030] Match case Unreachable Warning: tests/warn/enum-approx2.scala:7:12 ------------------------------------------- | ||
7 | case Fun(x: Exp[Int => String]) => ??? // warn: unreachable // warn: unchecked | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| Unreachable case | ||
-- [E121] Pattern Match Warning: tests/warn/enum-approx2.scala:8:9 ----------------------------------------------------- | ||
8 | case _ => // warn: unreachable-only-null | ||
| ^ | ||
| Unreachable case except for null (if this is intentional, consider writing case null => instead). | ||
-- [E092] Pattern Match Unchecked Warning: tests/warn/enum-approx2.scala:6:13 ------------------------------------------ | ||
6 | case Fun(x: Fun[Int, Double]) => ??? // warn: unchecked | ||
| ^ | ||
|the type test for Fun[Int, Double] cannot be checked at runtime because its type arguments can't be determined from Exp[Int => Int] | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E092] Pattern Match Unchecked Warning: tests/warn/enum-approx2.scala:7:13 ------------------------------------------ | ||
7 | case Fun(x: Exp[Int => String]) => ??? // warn: unreachable // warn: unchecked | ||
| ^ | ||
|the type test for Exp[Int => String] cannot be checked at runtime because its type arguments can't be determined from Exp[Int => Int] | ||
| | ||
| 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 @@ | ||
sealed trait Exp[T] | ||
case class Fun[A, B](f: Exp[A => B]) extends Exp[A => B] | ||
|
||
class Test { | ||
def eval(e: Fun[Int, Int]) = e match { | ||
case Fun(x: Fun[Int, Double]) => ??? // warn: unchecked | ||
case Fun(x: Exp[Int => String]) => ??? // warn: unreachable // warn: unchecked | ||
case _ => // warn: unreachable-only-null | ||
} | ||
} |
2 changes: 0 additions & 2 deletions
2
tests/neg-deep-subtype/i11178.scala → tests/warn/i11178.scala
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,3 @@ | ||
//> using options -Xfatal-warnings | ||
|
||
trait Box[+T] | ||
case class Foo[+S](s: S) extends Box[S] | ||
|
||
|
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,56 @@ | ||
-- [E030] Match case Unreachable Warning: tests/warn/i16451.scala:14:9 ------------------------------------------------- | ||
14 | case x: Wrapper[Color.Green.type] => None // warn: unreachable // warn: unchecked | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| Unreachable case | ||
-- [E030] Match case Unreachable Warning: tests/warn/i16451.scala:22:9 ------------------------------------------------- | ||
22 | case x: Wrapper[Color.Green.type] => None // warn: unreachable // warn: unchecked | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| Unreachable case | ||
-- [E092] Pattern Match Unchecked Warning: tests/warn/i16451.scala:13:9 ------------------------------------------------ | ||
13 | case x: Wrapper[Color.Red.type] => Some(x) // warn: unchecked | ||
| ^ | ||
|the type test for Wrapper[(Color.Red : Color)] cannot be checked at runtime because its type arguments can't be determined from Wrapper[Color] | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E092] Pattern Match Unchecked Warning: tests/warn/i16451.scala:14:9 ------------------------------------------------ | ||
14 | case x: Wrapper[Color.Green.type] => None // warn: unreachable // warn: unchecked | ||
| ^ | ||
|the type test for Wrapper[(Color.Green : Color)] cannot be checked at runtime because its type arguments can't be determined from Wrapper[Color] | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E092] Pattern Match Unchecked Warning: tests/warn/i16451.scala:21:9 ------------------------------------------------ | ||
21 | case x: Wrapper[Color.Red.type] => Some(x) // warn: unchecked | ||
| ^ | ||
|the type test for Wrapper[(Color.Red : Color)] cannot be checked at runtime because its type arguments can't be determined from Any | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E092] Pattern Match Unchecked Warning: tests/warn/i16451.scala:22:9 ------------------------------------------------ | ||
22 | case x: Wrapper[Color.Green.type] => None // warn: unreachable // warn: unchecked | ||
| ^ | ||
|the type test for Wrapper[(Color.Green : Color)] cannot be checked at runtime because its type arguments can't be determined from Any | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E092] Pattern Match Unchecked Warning: tests/warn/i16451.scala:25:9 ------------------------------------------------ | ||
25 | case x: Wrapper[Color.Red.type] => Some(x) // error: unreachable // error: unchecked | ||
| ^ | ||
|the type test for Wrapper[(Color.Red : Color)] cannot be checked at runtime because its type arguments can't be determined from Wrapper[Color] | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E092] Pattern Match Unchecked Warning: tests/warn/i16451.scala:29:9 ------------------------------------------------ | ||
29 | case x: Wrapper[Color.Red.type] => Some(x) | ||
| ^ | ||
|the type test for Wrapper[(Color.Red : Color)] cannot be checked at runtime because its type arguments can't be determined from A1 | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E092] Pattern Match Unchecked Warning: tests/warn/i16451.scala:34:11 ----------------------------------------------- | ||
34 | case x: Wrapper[Color.Red.type] => x | ||
| ^ | ||
|the type test for Wrapper[(Color.Red : Color)] cannot be checked at runtime because its type arguments can't be determined from Wrapper[Color] | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E092] Pattern Match Unchecked Warning: tests/warn/i16451.scala:39:11 ----------------------------------------------- | ||
39 | case x: Wrapper[Color.Red.type] => x | ||
| ^ | ||
|the type test for Wrapper[(Color.Red : Color)] cannot be checked at runtime because its type arguments can't be determined from Wrapper[Color] | ||
| | ||
| 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
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,34 @@ | ||
-- [E121] Pattern Match Warning: tests/warn/i5826.scala:9:9 ------------------------------------------------------------ | ||
9 | case _ => 0 // warn: unreachable-only-null | ||
| ^ | ||
| Unreachable case except for null (if this is intentional, consider writing case null => instead). | ||
-- [E092] Pattern Match Unchecked Warning: tests/warn/i5826.scala:3:9 -------------------------------------------------- | ||
3 | case ls: List[Int] => ls.head // error, A = List[String] | ||
| ^ | ||
| the type test for List[Int] cannot be checked at runtime because its type arguments can't be determined from A | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E092] Pattern Match Unchecked Warning: tests/warn/i5826.scala:8:9 -------------------------------------------------- | ||
8 | case ls: List[Int] => ls.head // warn: unchecked | ||
| ^ | ||
|the type test for List[Int] cannot be checked at runtime because its type arguments can't be determined from List[String] | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E092] Pattern Match Unchecked Warning: tests/warn/i5826.scala:17:9 ------------------------------------------------- | ||
17 | case ls: A[X] => 4 // error | ||
| ^ | ||
|the type test for Foo.this.A[X] cannot be checked at runtime because its type arguments can't be determined from Foo.this.B[X] | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E092] Pattern Match Unchecked Warning: tests/warn/i5826.scala:22:9 ------------------------------------------------- | ||
22 | case ls: List[Int] => ls.head // error, List extends Int => T | ||
| ^ | ||
|the type test for List[Int] cannot be checked at runtime because its type arguments can't be determined from A => Int | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E092] Pattern Match Unchecked Warning: tests/warn/i5826.scala:28:54 ------------------------------------------------ | ||
28 | def test5[T](x: A[T] | B[T] | Option[T]): Boolean = x.isInstanceOf[C[String]] // error | ||
| ^ | ||
|the type test for Foo.this.C[String] cannot be checked at runtime because its type arguments can't be determined from Foo.this.A[T] | ||
| | ||
| 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
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,3 @@ | ||
//> using options -Xfatal-warnings | ||
|
||
sealed trait Foo[+A] | ||
case class Bar[A]() extends Foo[A] | ||
|
||
|
2 changes: 0 additions & 2 deletions
2
...s/neg/suppressed-type-test-warnings.scala → .../warn/suppressed-type-test-warnings.scala
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