We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 20026ec commit 799de6cCopy full SHA for 799de6c
compiler/src/dotty/tools/dotc/transform/patmat/Space.scala
@@ -61,10 +61,14 @@ sealed trait Space:
61
private val isSubspaceCache = mutable.HashMap.empty[Space, Boolean]
62
63
def isSubspace(b: Space)(using Context): Boolean =
64
- if this == Empty then true
+ val a = this
65
+ val a2 = a.simplify
66
+ val b2 = b.simplify
67
+ if (a ne a2) || (b ne b2) then a2.isSubspace(b2)
68
+ else if a == Empty then true
69
else if b == Empty then false
70
else trace(s"isSubspace(${show(this)}, ${show(b)})", debug) {
- isSubspaceCache.getOrElseUpdate(b, computeIsSubspace(this, b))
71
+ isSubspaceCache.getOrElseUpdate(b, computeIsSubspace(a, b))
72
}
73
74
private var mySimplify: Space | Null = _
0 commit comments