Skip to content

Commit 080be4d

Browse files
committed
Fix typo and add test
1 parent de00948 commit 080be4d

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

compiler/src/dotty/tools/dotc/transform/patmat/Space.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
380380
* cause false unreachable warnings. See tests/patmat/t2425.scala
381381
*
382382
* We cannot use type erasure here, as it would lose the constraints
383-
* invovling GADTs. For example, in the following code, type
383+
* involving GADTs. For example, in the following code, type
384384
* erasure would loose the constraint that `x` and `y` must be
385385
* the same type, resulting in false inexhaustive warnings:
386386
*

tests/patmat/i6197d.check

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
5: Pattern Match Exhaustivity: _: Array[String]

tests/patmat/i6197d.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
def foo(x: Array[String]) = x match {
2+
case _: Array[_] =>
3+
}
4+
5+
def bar(x: Array[String]) = x match {
6+
case _: Array[_ <: Int] =>
7+
}

0 commit comments

Comments
 (0)