Skip to content

Commit 2157a45

Browse files
committed
remove limitation errors in testcases
Thanks to the path-dependent GADT reasoning logic, these limitation errors can be dropped from the testcases. See #14754.
1 parent 4f41b9e commit 2157a45

5 files changed

+18
-22
lines changed

tests/neg/structural-gadt.scala

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
// This file is part of tests for inferring GADT constraints from type members,
2-
// which needed to be reverted because of soundness issues.
3-
//
4-
// Lines with "// limitation" are the ones that we could soundly allow.
1+
// This file is part of tests for inferring GADT constraints from type members.
2+
// They are now supported by path-dependent GADT reasoning. See #14754.
53
object Test {
64

75
trait Expr { type T }
@@ -11,19 +9,19 @@ object Test {
119
def foo[A](e: Expr { type T = A }) = e match {
1210
case _: IntLit =>
1311
val a: A = 0 // error
14-
val i: Int = ??? : A // limitation // error
12+
val i: Int = ??? : A
1513

1614
case _: Expr { type T <: Int } =>
1715
val a: A = 0 // error
18-
val i: Int = ??? : A // limitation // error
16+
val i: Int = ??? : A
1917

2018
case _: IntExpr =>
2119
val a: A = 0
22-
val i: Int = ??? : A // limitation // error
20+
val i: Int = ??? : A
2321

2422
case _: Expr { type T = Int } =>
2523
val a: A = 0
26-
val i: Int = ??? : A // limitation // error
24+
val i: Int = ??? : A
2725
}
2826

2927
def bar[A](e: Expr { type T <: A }) = e match {

tests/neg/structural-recursive-both1-gadt.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// This file is part of tests for inferring GADT constraints from type members,
2-
// which needed to be reverted because of soundness issues.
1+
// This file is part of tests for inferring GADT constraints from type members.
2+
// They are now supported by path-dependent GADT reasoning. See #14754.
33
//
44
// Lines with "// limitation" are the ones that we could soundly allow.
55
object Test {

tests/neg/structural-recursive-both2-gadt.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// This file is part of tests for inferring GADT constraints from type members,
2-
// which needed to be reverted because of soundness issues.
1+
// This file is part of tests for inferring GADT constraints from type members.
2+
// They are now supported by path-dependent GADT reasoning. See #14754.
33
//
44
// Lines with "// limitation" are the ones that we could soundly allow.
55
object Test {

tests/neg/structural-recursive-pattern-gadt.scala

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
// This file is part of tests for inferring GADT constraints from type members,
2-
// which needed to be reverted because of soundness issues.
3-
//
4-
// Lines with "// limitation" are the ones that we could soundly allow.
1+
// This file is part of tests for inferring GADT constraints from type members.
2+
// They are now supported by path-dependent GADT reasoning. See #14754.
53
object Test {
64

75
trait Expr { type T }
@@ -28,23 +26,23 @@ object Test {
2826
def foo[A](e: ExprExact[A]) = e match {
2927
case _: IndirectIntLit =>
3028
val a: A = 0 // error
31-
val i: Int = ??? : A // limitation // error
29+
val i: Int = ??? : A
3230

3331
case _: IndirectExprSub[Int] =>
3432
val a: A = 0 // error
35-
val i: Int = ??? : A // limitation // error
33+
val i: Int = ??? : A
3634

3735
case _: IndirectExprSub2[Int] =>
3836
val a: A = 0 // error
39-
val i: Int = ??? : A // limitation // error
37+
val i: Int = ??? : A
4038

4139
case _: IndirectIntExpr =>
4240
val a: A = 0
4341
val i: Int = ??? : A
4442

4543
case _: IndirectExprExact[Int] =>
4644
val a: A = 0
47-
val i: Int = ??? : A // limitation // error
45+
val i: Int = ??? : A
4846
}
4947

5048
def bar[A](e: ExprSub[A]) = e match {

tests/neg/structural-recursive-scrutinee-gadt.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// This file is part of tests for inferring GADT constraints from type members,
2-
// which needed to be reverted because of soundness issues.
1+
// This file is part of tests for inferring GADT constraints from type members.
2+
// They are now supported by path-dependent GADT reasoning. See #14754.
33
//
44
// Lines with "// limitation" are the ones that we could soundly allow.
55
object Test {

0 commit comments

Comments
 (0)