Skip to content

Commit 9ea195f

Browse files
committed
Drop seemingly needless OrType#join
1 parent 29cf778 commit 9ea195f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,7 @@ object PatternMatcher {
336336

337337
if (isSyntheticScala2Unapply(unapp.symbol) && caseAccessors.length == args.length)
338338
def tupleSel(sym: Symbol) = ref(scrutinee).select(sym)
339-
val isGenericTuple = defn.isTupleClass(caseClass) &&
340-
!defn.isTupleNType(tree.tpe match { case tp: OrType => tp.join case tp => tp }) // widen even hard unions, to see if it's a union of tuples
339+
val isGenericTuple = defn.isTupleClass(caseClass) && !defn.isTupleNType(tree.tpe)
341340
val components = if isGenericTuple then caseAccessors.indices.toList.map(tupleApp(_, ref(scrutinee))) else caseAccessors.map(tupleSel)
342341
matchArgsPlan(components, args, onSuccess)
343342
else if (unapp.tpe <:< (defn.BooleanType))

0 commit comments

Comments
 (0)