Skip to content

Commit

Permalink
Backport "Space: Replace showType & make Space Showable" to LTS (#20816)
Browse files Browse the repository at this point in the history
Backports #19370 to the LTS branch.

PR submitted by the release tooling.
[skip ci]
  • Loading branch information
WojciechMazur authored Jun 28, 2024
2 parents 4e3dbed + 840f6a3 commit 6941e0b
Show file tree
Hide file tree
Showing 10 changed files with 106 additions and 173 deletions.
232 changes: 86 additions & 146 deletions compiler/src/dotty/tools/dotc/transform/patmat/Space.scala

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ class SpaceEngineTest:
val a = Prod(tp, unappTp, params)
val b = Empty

val res1 = isSubspace(a, b)
val res1 = a.isSubspace(b)

val a2 = simplify(a)
val b2 = simplify(b)
val a2 = a.simplify
val b2 = b.simplify
val rem1 = minus(a2, b2)
val rem2 = simplify(rem1)
val rem2 = rem1.simplify
val res2 = rem2 == Empty

assertEquals(
Expand All @@ -46,19 +46,12 @@ class SpaceEngineTest:
|simplify(rem1) == Empty
|rem2 == Empty
|
|a = ${show(a)}
|b = ${show(b)}
|a2 = ${show(a2)}
|b2 = ${show(b2)}
|rem1 = ${show(rem1)}
|rem2 = ${show(rem2)}
|
|a = ${a.toString}
|b = ${b.toString}
|a2 = ${a2.toString}
|b2 = ${b2.toString}
|rem1 = ${rem1.toString}
|rem2 = ${rem2.toString}
|a = $a
|b = $b
|a2 = $a2
|b2 = $b2
|rem1 = $rem1
|rem2 = $rem2
|
|""".stripMargin, res1, res2)
}
6 changes: 3 additions & 3 deletions tests/patmat/aliasing.check
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
14: Pattern Match Exhaustivity: _: Trait & Test.Alias1, _: Clazz & Test.Alias1
19: Pattern Match Exhaustivity: _: Trait & Test.Alias2
23: Pattern Match Exhaustivity: _: Trait & (Test.Alias2 & OpenTrait2){val x: Int}
14: Pattern Match Exhaustivity: _: Trait & Alias1, _: Clazz & Alias1
19: Pattern Match Exhaustivity: _: Trait & Alias2
23: Pattern Match Exhaustivity: _: Trait & (Alias2 & OpenTrait2){val x: Int}
2 changes: 1 addition & 1 deletion tests/patmat/i12020.check
Original file line number Diff line number Diff line change
@@ -1 +1 @@
19: Pattern Match Exhaustivity: _: TypeDef
19: Pattern Match Exhaustivity: _: x$1.reflect.TypeDef
2 changes: 1 addition & 1 deletion tests/patmat/i2502.check
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5: Pattern Match Exhaustivity: _: BTypes.ClassBType
5: Pattern Match Exhaustivity: _: BTypes.this.ClassBType
2 changes: 1 addition & 1 deletion tests/patmat/i2502b.check
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5: Pattern Match Exhaustivity: _: BTypes.ClassBType
5: Pattern Match Exhaustivity: _: BTypes.this.ClassBType
2 changes: 1 addition & 1 deletion tests/patmat/i3938.check
Original file line number Diff line number Diff line change
@@ -1 +1 @@
34: Pattern Match Exhaustivity: bar.C()
34: Pattern Match Exhaustivity: foo.bar.C()
2 changes: 1 addition & 1 deletion tests/patmat/i6255b.check
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3: Pattern Match Exhaustivity: _: Expr[Int]
3: Pattern Match Exhaustivity: _: scala.quoted.Expr[Int]
2 changes: 1 addition & 1 deletion tests/patmat/t10100.check
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12: Pattern Match Exhaustivity: (_, FancyFoo(_))
12: Pattern Match Exhaustivity: (_, NonExhaustive#FancyFoo(_))
2 changes: 1 addition & 1 deletion tests/patmat/t9779.check
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10: Pattern Match Exhaustivity: _: a.Elem[_]
10: Pattern Match Exhaustivity: _: a.Elem[?]

0 comments on commit 6941e0b

Please sign in to comment.