File tree 1 file changed +6
-2
lines changed
compiler/src/dotty/tools/dotc/transform/patmat
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -516,10 +516,14 @@ object SpaceEngine {
516
516
* We assume that unapply methods are pure, but the same method may
517
517
* be called with different prefixes, thus behaving differently.
518
518
*/
519
- def isSameUnapply (tp1 : TermRef , tp2 : TermRef )(using Context ): Boolean =
519
+ def isSameUnapply (tp1 : TermRef , tp2 : TermRef )(using Context ): Boolean = trace(i " isSameUnapply( $tp1, $tp2) " ) {
520
+ def isStable (tp : TermRef ) =
521
+ ! tp.symbol.is(ExtensionMethod ) // The "prefix" of an extension method may be, but the receiver isn't, so exclude
522
+ && tp.prefix.isStable
520
523
// always assume two TypeTest[S, T].unapply are the same if they are equal in types
521
- (tp1.prefix. isStable && tp2.prefix. isStable || tp1.symbol == defn.TypeTest_unapply )
524
+ (isStable(tp1) && isStable(tp2) || tp1.symbol == defn.TypeTest_unapply )
522
525
&& tp1 =:= tp2
526
+ }
523
527
524
528
/** Return term parameter types of the extractor `unapp`.
525
529
* Parameter types of the case class type `tp`. Adapted from `unapplyPlan` in patternMatcher */
You can’t perform that action at this time.
0 commit comments