File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
compiler/src/dotty/tools/dotc/transform/patmat Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -521,7 +521,9 @@ class SpaceEngine(using Context) extends SpaceLogic {
521
521
}
522
522
523
523
def isSameUnapply (tp1 : TermRef , tp2 : TermRef ): Boolean =
524
- tp1.prefix.isStable && tp2.prefix.isStable && tp1 =:= tp2
524
+ // always assume two TypeTest[S, T].unapply are the same if they are equal in types
525
+ (tp1.prefix.isStable && tp2.prefix.isStable || tp1.symbol == defn.TypeTest_unapply )
526
+ && tp1 =:= tp2
525
527
526
528
/** Parameter types of the case class type `tp`. Adapted from `unapplyPlan` in patternMatcher */
527
529
def signature (unapp : TermRef , scrutineeTp : Type , argLen : Int ): List [Type ] = {
Original file line number Diff line number Diff line change
1
+ 19: Pattern Match Exhaustivity: _: TypeDef
You can’t perform that action at this time.
0 commit comments