Skip to content

Commit 73d2404

Browse files
committed
PR comments
1 parent da1f626 commit 73d2404

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

compiler/src/dotty/tools/dotc/core/StdNames.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ object StdNames {
396396
val This: N = "This"
397397
val ThisType: N = "ThisType"
398398
val Tuple2: N = "Tuple2"
399+
val Tuple: N = "Tuple"
399400
val TYPE_ : N = "TYPE"
400401
val TypeApply: N = "TypeApply"
401402
val TypeRef: N = "TypeRef"

compiler/src/dotty/tools/dotc/typer/Synthesizer.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,13 +434,13 @@ class Synthesizer(typer: Typer)(using @constructorOnly c: Context):
434434

435435
def makeTupleProductMirror(tps: List[Type]): TreeWithErrors =
436436
val arity = tps.size
437-
if arity < Definitions.MaxTupleArity then
437+
if arity <= Definitions.MaxTupleArity then
438438
val tupleCls = defn.TupleType(arity).nn.classSymbol
439439
makeClassProductMirror(tupleCls.owner.reachableThisType, tupleCls, Some(tps))
440440
else
441441
val elemLabels = (for i <- 1 to arity yield ConstantType(Constant(s"_$i"))).toList
442442
val mirrorRef: Type => Tree = _ => newTupleMirror(arity)
443-
makeProductMirror(tps, elemLabels, s"Tuple$arity".toTermName, mirrorRef)
443+
makeProductMirror(tps, elemLabels, tpnme.Tuple, mirrorRef)
444444
end makeTupleProductMirror
445445

446446
def makeClassProductMirror(pre: Type, cls: Symbol, tps: Option[List[Type]]) =

tests/pos/i15398.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ object i15398 {
33

44
summon[Tuple.Size[Tuple23] =:= 23]
55
val m = summon[scala.deriving.Mirror.Of[Tuple23]]
6-
summon[m.MirroredLabel =:= "Tuple23"]
6+
summon[m.MirroredLabel =:= "Tuple"]
77
summon[m.MirroredElemTypes =:= Tuple23]
88
summon[m.MirroredElemLabels =:= ("_1", "_2", "_3", "_4", "_5", "_6", "_7", "_8", "_9", "_10", "_11", "_12", "_13", "_14", "_15", "_16", "_17", "_18", "_19", "_20", "_21", "_22", "_23")]
99
}

0 commit comments

Comments
 (0)