@@ -705,14 +705,16 @@ class Definitions {
705
705
lazy val QuotedExprType : TypeRef = ctx.requiredClassRef(" scala.quoted.Expr" )
706
706
def QuotedExprClass (implicit ctx : Context ): ClassSymbol = QuotedExprType .symbol.asClass
707
707
708
- lazy val InternalQuotedModule : TermRef = ctx.requiredModuleRef(" scala.internal.Quoted" )
709
- def InternalQuotedModuleClass : Symbol = InternalQuotedModule .symbol
710
- lazy val InternalQuoted_exprQuoteR : TermRef = InternalQuotedModuleClass .requiredMethodRef(" exprQuote" .toTermName )
708
+ lazy val InternalQuotedModuleRef : TermRef = ctx.requiredModuleRef(" scala.internal.Quoted" )
709
+ def InternalQuotedModule : Symbol = InternalQuotedModuleRef .symbol
710
+ lazy val InternalQuoted_exprQuoteR : TermRef = InternalQuotedModule .requiredMethodRef(" exprQuote" )
711
711
def InternalQuoted_exprQuote (implicit ctx : Context ): Symbol = InternalQuoted_exprQuoteR .symbol
712
- lazy val InternalQuoted_exprSpliceR : TermRef = InternalQuotedModuleClass .requiredMethodRef(" exprSplice" .toTermName )
712
+ lazy val InternalQuoted_exprSpliceR : TermRef = InternalQuotedModule .requiredMethodRef(" exprSplice" )
713
713
def InternalQuoted_exprSplice (implicit ctx : Context ): Symbol = InternalQuoted_exprSpliceR .symbol
714
- lazy val InternalQuoted_typeQuoteR : TermRef = InternalQuotedModuleClass .requiredMethodRef(" typeQuote" .toTermName )
714
+ lazy val InternalQuoted_typeQuoteR : TermRef = InternalQuotedModule .requiredMethodRef(" typeQuote" )
715
715
def InternalQuoted_typeQuote (implicit ctx : Context ): Symbol = InternalQuoted_typeQuoteR .symbol
716
+ lazy val InternalQuoted_patternHoleR : TermRef = InternalQuotedModule .requiredMethodRef(" patternHole" )
717
+ def InternalQuoted_patternHole (implicit ctx : Context ): Symbol = InternalQuoted_patternHoleR .symbol
716
718
717
719
lazy val QuotedExprsModule : TermSymbol = ctx.requiredModule(" scala.quoted.Exprs" )
718
720
def QuotedExprsClass (implicit ctx : Context ): ClassSymbol = QuotedExprsModule .asClass
@@ -723,24 +725,8 @@ class Definitions {
723
725
lazy val QuotedType_spliceR : TypeRef = QuotedTypeClass .requiredType(tpnme.splice).typeRef
724
726
def QuotedType_splice : Symbol = QuotedType_spliceR .symbol
725
727
726
- lazy val QuotedTypeModuleType : TermRef = ctx.requiredModuleRef(" scala.quoted.Type" )
727
- def QuotedTypeModule (implicit ctx : Context ): Symbol = QuotedTypeModuleType .symbol
728
-
729
- lazy val QuotedLiftableModule : TermSymbol = ctx.requiredModule(" scala.quoted.Liftable" )
730
- def QuotedLiftableModuleClass (implicit ctx : Context ): ClassSymbol = QuotedLiftableModule .asClass
731
-
732
- def QuotedLiftable_BooleanIsLiftable : TermRef = QuotedLiftableModule .requiredMethodRef(" BooleanIsLiftable" )
733
- def QuotedLiftable_ByteIsLiftable : TermRef = QuotedLiftableModule .requiredMethodRef(" ByteIsLiftable" )
734
- def QuotedLiftable_CharIsLiftable : TermRef = QuotedLiftableModule .requiredMethodRef(" CharIsLiftable" )
735
- def QuotedLiftable_ShortIsLiftable : TermRef = QuotedLiftableModule .requiredMethodRef(" ShortIsLiftable" )
736
- def QuotedLiftable_IntIsLiftable : TermRef = QuotedLiftableModule .requiredMethodRef(" IntIsLiftable" )
737
- def QuotedLiftable_LongIsLiftable : TermRef = QuotedLiftableModule .requiredMethodRef(" LongIsLiftable" )
738
- def QuotedLiftable_FloatIsLiftable : TermRef = QuotedLiftableModule .requiredMethodRef(" FloatIsLiftable" )
739
- def QuotedLiftable_DoubleIsLiftable : TermRef = QuotedLiftableModule .requiredMethodRef(" DoubleIsLiftable" )
740
- def QuotedLiftable_StringIsLiftable : TermRef = QuotedLiftableModule .requiredMethodRef(" StringIsLiftable" )
741
-
742
- lazy val QuotedLiftableType : TypeRef = ctx.requiredClassRef(" scala.quoted.Liftable" )
743
- def QuotedLiftableClass (implicit ctx : Context ): ClassSymbol = QuotedLiftableType .symbol.asClass
728
+ lazy val QuotedTypeModuleRef : TermRef = ctx.requiredModuleRef(" scala.quoted.Type" )
729
+ def QuotedTypeModule (implicit ctx : Context ): Symbol = QuotedTypeModuleRef .symbol
744
730
745
731
def Unpickler_unpickleExpr : TermSymbol = ctx.requiredMethod(" scala.runtime.quoted.Unpickler.unpickleExpr" )
746
732
def Unpickler_liftedExpr : TermSymbol = ctx.requiredMethod(" scala.runtime.quoted.Unpickler.liftedExpr" )
@@ -752,6 +738,12 @@ class Definitions {
752
738
lazy val TastyReflectionModule : TermSymbol = ctx.requiredModule(" scala.tasty.Reflection" )
753
739
lazy val TastyReflection_macroContext : TermSymbol = TastyReflectionModule .requiredMethod(" macroContext" )
754
740
741
+ lazy val QuotedMatcherModuleRef : TermRef = ctx.requiredModuleRef(" scala.runtime.quoted.Matcher" )
742
+ def QuotedMatcherModule (implicit ctx : Context ): Symbol = QuotedMatcherModuleRef .symbol
743
+
744
+ lazy val QuotedMatcher_unapplyR : TermRef = QuotedMatcherModule .requiredMethodRef(nme.unapply)
745
+ def QuotedMatcher_unapply (implicit ctx : Context ) = QuotedMatcher_unapplyR .symbol
746
+
755
747
lazy val EqlType : TypeRef = ctx.requiredClassRef(" scala.Eql" )
756
748
def EqlClass (implicit ctx : Context ): ClassSymbol = EqlType .symbol.asClass
757
749
def EqlModule (implicit ctx : Context ): Symbol = EqlClass .companionModule
@@ -1178,7 +1170,9 @@ class Definitions {
1178
1170
}
1179
1171
1180
1172
def tupleType (elems : List [Type ]): Type = {
1181
- TupleType (elems.size).appliedTo(elems)
1173
+ val arity = elems.length
1174
+ if (arity <= MaxTupleArity && TupleType (arity) != null ) TupleType (arity).appliedTo(elems)
1175
+ else TypeOps .nestedPairs(elems)
1182
1176
}
1183
1177
1184
1178
def isProductSubType (tp : Type )(implicit ctx : Context ): Boolean =
@@ -1271,8 +1265,9 @@ class Definitions {
1271
1265
def adjustForTuple (cls : ClassSymbol , tparams : List [TypeSymbol ], parents : List [Type ]): List [Type ] = {
1272
1266
def syntheticParent (tparams : List [TypeSymbol ]): Type =
1273
1267
if (tparams.isEmpty) TupleTypeRef
1274
- else (tparams :\ (UnitType : Type )) ((tparam, tail) => PairType .appliedTo(tparam.typeRef, tail))
1275
- if (isTupleClass(cls) || cls == UnitClass ) parents :+ syntheticParent(tparams) else parents
1268
+ else TypeOps .nestedPairs(tparams.map(_.typeRef))
1269
+ if (isTupleClass(cls) || cls == UnitClass ) parents :+ syntheticParent(tparams)
1270
+ else parents
1276
1271
}
1277
1272
1278
1273
// ----- primitive value class machinery ------------------------------------------
0 commit comments