Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport "Space: Replace showType & make Space Showable" to LTS #20816

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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[?]