We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 582ebd0 commit b88d4c6Copy full SHA for b88d4c6
compiler/src/dotty/tools/dotc/typer/Typer.scala
@@ -2447,7 +2447,13 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
2447
// wrt to operand order for `&`, we include the explicit subtype test here.
2448
// See also #5649.
2449
then body1.tpe
2450
- else pt & body1.tpe
+ else body1.tpe match
2451
+ case btpe: TypeRef
2452
+ if btpe.symbol == defn.TupleXXLClass && pt.tupleElementTypes.isDefined =>
2453
+ // leave the original tuple type; don't mix with & TupleXXL which would only obscure things
2454
+ pt
2455
+ case _ =>
2456
+ pt & body1.tpe
2457
val sym = newPatternBoundSymbol(name, symTp, tree.span)
2458
if (pt == defn.ImplicitScrutineeTypeRef || tree.mods.is(Given)) sym.setFlag(Given)
2459
if (ctx.mode.is(Mode.InPatternAlternative))
0 commit comments