Skip to content

Commit e99a26d

Browse files
committed
Construct MethodTypes from parameter closure
To allow for dependencies between method type parameters, construct MethodTypes from a closure that maps the currently constructed MethodType to its parameter types.
1 parent fac74a6 commit e99a26d

25 files changed

+108
-96
lines changed

compiler/src/dotty/tools/backend/jvm/CollectEntryPoints.scala

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class CollectEntryPoints extends MiniPhaseTransform {
4949
object CollectEntryPoints{
5050
def isJavaMainMethod(sym: Symbol)(implicit ctx: Context) = {
5151
(sym.name == nme.main) && (sym.info match {
52-
case r@MethodType(_, List(defn.ArrayOf(t))) =>
52+
case r@MethodTpe(_, List(defn.ArrayOf(t)), _) =>
5353
(t.widenDealias =:= defn.StringType) && (
5454
r.resultType.widenDealias =:= defn.UnitType)
5555
case _ => false
@@ -81,9 +81,8 @@ object CollectEntryPoints{
8181
val possibles = if (sym.flags is Flags.Module) (toDenot(sym).info nonPrivateMember nme.main).alternatives else Nil
8282
val hasApproximate = possibles exists { m =>
8383
m.info match {
84-
case MethodType(_, p :: Nil) =>
85-
p.typeSymbol == defn.ArrayClass
86-
case _ => false
84+
case MethodTpe(_, p :: Nil, _) => p.typeSymbol == defn.ArrayClass
85+
case _ => false
8786
}
8887
}
8988
// At this point it's a module with a main-looking method, so either succeed or warn that it isn't.
@@ -108,8 +107,8 @@ object CollectEntryPoints{
108107
toDenot(m.symbol).info match {
109108
case t: PolyType =>
110109
fail("main methods cannot be generic.")
111-
case t@MethodType(paramNames, paramTypes) =>
112-
if (t.resultType :: paramTypes exists (_.typeSymbol.isAbstractType))
110+
case MethodTpe(paramNames, paramTypes, resultType) =>
111+
if (resultType :: paramTypes exists (_.typeSymbol.isAbstractType))
113112
fail("main methods cannot refer to type parameters or abstract types.", m.symbol.pos)
114113
else
115114
isJavaMainMethod(m.symbol) || fail("main method must have exact signature (Array[String])Unit", m.symbol.pos)

compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma
531531
tree match {
532532
case Apply(fun, args) =>
533533
fun.tpe.widen match {
534-
case MethodType(names, _) =>
534+
case MethodType(names) =>
535535
names zip args
536536
}
537537
}

compiler/src/dotty/tools/dotc/ast/tpd.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,12 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
185185
}
186186

187187
def valueParamss(tp: Type): (List[List[TermSymbol]], Type) = tp match {
188-
case tp @ MethodType(paramNames, paramTypes) =>
188+
case tp: MethodType =>
189189
def valueParam(name: TermName, info: Type): TermSymbol = {
190190
val maybeImplicit = if (tp.isInstanceOf[ImplicitMethodType]) Implicit else EmptyFlags
191191
ctx.newSymbol(sym, name, TermParam | maybeImplicit, info)
192192
}
193-
val params = (paramNames, paramTypes).zipped.map(valueParam)
193+
val params = (tp.paramNames, tp.paramTypes).zipped.map(valueParam)
194194
val (paramss, rtp) = valueParamss(tp.instantiate(params map (_.termRef)))
195195
(params :: paramss, rtp)
196196
case tp => (Nil, tp.widenExpr)

compiler/src/dotty/tools/dotc/config/JavaPlatform.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class JavaPlatform extends Platform {
2323
// The given symbol is a method with the right name and signature to be a runnable java program.
2424
def isJavaMainMethod(sym: SymDenotation)(implicit ctx: Context) =
2525
(sym.name == nme.main) && (sym.info match {
26-
case t@MethodType(_, defn.ArrayOf(el) :: Nil) => el =:= defn.StringType && (t.resultType isRef defn.UnitClass)
26+
case MethodTpe(_, defn.ArrayOf(el) :: Nil, restpe) => el =:= defn.StringType && (restpe isRef defn.UnitClass)
2727
case _ => false
2828
})
2929

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -308,13 +308,13 @@ object Denotations {
308308
case tp2: TypeBounds if tp2 contains tp1 => tp1
309309
case _ => mergeConflict(tp1, tp2)
310310
}
311-
case tp1 @ MethodType(names1, formals1) if isTerm =>
311+
case tp1: MethodType if isTerm =>
312312
tp2 match {
313-
case tp2 @ MethodType(names2, formals2) if ctx.typeComparer.matchingParams(formals1, formals2, tp1.isJava, tp2.isJava) &&
313+
case tp2: MethodType if ctx.typeComparer.matchingParams(tp1.paramTypes, tp2.paramTypes, tp1.isJava, tp2.isJava) &&
314314
tp1.isImplicit == tp2.isImplicit =>
315315
tp1.derivedMethodType(
316-
mergeNames(names1, names2, nme.syntheticParamName),
317-
formals1,
316+
mergeNames(tp1.paramNames, tp2.paramNames, nme.syntheticParamName),
317+
tp1.paramTypes,
318318
infoMeet(tp1.resultType, tp2.resultType.subst(tp2, tp1)))
319319
case _ =>
320320
mergeConflict(tp1, tp2)
@@ -471,14 +471,14 @@ object Denotations {
471471
case tp2: TypeBounds if tp2 contains tp1 => tp2
472472
case _ => mergeConflict(tp1, tp2)
473473
}
474-
case tp1 @ MethodType(names1, formals1) =>
474+
case tp1: MethodType =>
475475
tp2 match {
476-
case tp2 @ MethodType(names2, formals2)
477-
if ctx.typeComparer.matchingParams(formals1, formals2, tp1.isJava, tp2.isJava) &&
476+
case tp2: MethodType
477+
if ctx.typeComparer.matchingParams(tp1.paramTypes, tp2.paramTypes, tp1.isJava, tp2.isJava) &&
478478
tp1.isImplicit == tp2.isImplicit =>
479479
tp1.derivedMethodType(
480-
mergeNames(names1, names2, nme.syntheticParamName),
481-
formals1, tp1.resultType | tp2.resultType.subst(tp2, tp1))
480+
mergeNames(tp1.paramNames, tp2.paramNames, nme.syntheticParamName),
481+
tp1.paramTypes, tp1.resultType | tp2.resultType.subst(tp2, tp1))
482482
case _ =>
483483
mergeConflict(tp1, tp2)
484484
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -484,11 +484,11 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
484484
case _ =>
485485
}
486486
either(isSubType(tp1, tp21), isSubType(tp1, tp22)) || fourthTry(tp1, tp2)
487-
case tp2 @ MethodType(_, formals2) =>
487+
case tp2: MethodType =>
488488
def compareMethod = tp1 match {
489-
case tp1 @ MethodType(_, formals1) =>
489+
case tp1: MethodType =>
490490
(tp1.signature consistentParams tp2.signature) &&
491-
matchingParams(formals1, formals2, tp1.isJava, tp2.isJava) &&
491+
matchingParams(tp1.paramTypes, tp2.paramTypes, tp1.isJava, tp2.isJava) &&
492492
(tp1.isImplicit == tp2.isImplicit) &&
493493
isSubType(tp1.resultType, tp2.resultType.subst(tp2, tp1))
494494
case _ =>
@@ -503,7 +503,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
503503
// as members of the same type. And it seems most logical to take
504504
// ()T <:< => T, since everything one can do with a => T one can
505505
// also do with a ()T by automatic () insertion.
506-
case tp1 @ MethodType(Nil, _) => isSubType(tp1.resultType, restpe2)
506+
case tp1 @ MethodType(Nil) => isSubType(tp1.resultType, restpe2)
507507
case _ => isSubType(tp1.widenExpr, restpe2)
508508
}
509509
compareExpr

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

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,14 @@ object Types {
217217
*/
218218
def isVarArgsMethod(implicit ctx: Context): Boolean = this match {
219219
case tp: PolyType => tp.resultType.isVarArgsMethod
220-
case MethodType(_, paramTypes) => paramTypes.nonEmpty && paramTypes.last.isRepeatedParam
220+
case mt: MethodType => mt.paramTypes.nonEmpty && mt.paramTypes.last.isRepeatedParam
221221
case _ => false
222222
}
223223

224224
/** Is this the type of a method with a leading empty parameter list?
225225
*/
226226
def isNullaryMethod(implicit ctx: Context): Boolean = this match {
227-
case MethodType(Nil, _) => true
227+
case MethodType(Nil) => true
228228
case tp: PolyType => tp.resultType.isNullaryMethod
229229
case _ => false
230230
}
@@ -732,7 +732,7 @@ object Types {
732732
*/
733733
final def overrides(that: Type)(implicit ctx: Context) = {
734734
def result(tp: Type): Type = tp match {
735-
case ExprType(_) | MethodType(Nil, _) => tp.resultType
735+
case ExprType(_) | MethodType(Nil) => tp.resultType
736736
case _ => tp
737737
}
738738
(this frozen_<:< that) || {
@@ -1218,8 +1218,8 @@ object Types {
12181218
* when forming the function type.
12191219
*/
12201220
def toFunctionType(dropLast: Int = 0)(implicit ctx: Context): Type = this match {
1221-
case mt @ MethodType(_, formals) if !mt.isDependent || ctx.mode.is(Mode.AllowDependentFunctions) =>
1222-
val formals1 = if (dropLast == 0) formals else formals dropRight dropLast
1221+
case mt: MethodType if !mt.isDependent || ctx.mode.is(Mode.AllowDependentFunctions) =>
1222+
val formals1 = if (dropLast == 0) mt.paramTypes else mt.paramTypes dropRight dropLast
12231223
defn.FunctionOf(
12241224
formals1 mapConserve (_.underlyingIfRepeated(mt.isJava)), mt.resultType, mt.isImplicit && !ctx.erasedTypes)
12251225
}
@@ -2312,14 +2312,16 @@ object Types {
23122312

23132313
trait MethodOrPoly extends MethodicType
23142314

2315-
abstract case class MethodType(paramNames: List[TermName], paramTypes: List[Type])
2316-
(resultTypeExp: MethodType => Type)
2315+
abstract case class MethodType(paramNames: List[TermName])(
2316+
paramTypesExp: MethodType => List[Type],
2317+
resultTypeExp: MethodType => Type)
23172318
extends CachedGroundType with BindingType with TermType with MethodOrPoly with NarrowCached { thisMethodType =>
23182319
import MethodType._
23192320

23202321
def isJava = false
23212322
def isImplicit = false
23222323

2324+
val paramTypes = paramTypesExp(this)
23232325
private[core] val resType = resultTypeExp(this)
23242326
assert(resType.exists)
23252327

@@ -2399,10 +2401,11 @@ object Types {
23992401
resType: Type = this.resType)(implicit ctx: Context) =
24002402
if ((paramNames eq this.paramNames) && (paramTypes eq this.paramTypes) && (resType eq this.resType)) this
24012403
else {
2404+
val paramTypesFn = (x: MethodType) => paramTypes.map(_.subst(this, x))
24022405
val resTypeFn = (x: MethodType) => resType.subst(this, x)
2403-
if (isJava) JavaMethodType(paramNames, paramTypes)(resTypeFn)
2404-
else if (isImplicit) ImplicitMethodType(paramNames, paramTypes)(resTypeFn)
2405-
else MethodType(paramNames, paramTypes)(resTypeFn)
2406+
if (isJava) JavaMethodType(paramNames)(paramTypesFn, resTypeFn)
2407+
else if (isImplicit) ImplicitMethodType(paramNames)(paramTypesFn, resTypeFn)
2408+
else MethodType(paramNames)(paramTypesFn, resTypeFn)
24062409
}
24072410

24082411
def instantiate(argTypes: => List[Type])(implicit ctx: Context): Type =
@@ -2424,29 +2427,31 @@ object Types {
24242427
override def toString = s"$prefixString($paramNames, $paramTypes, $resType)"
24252428
}
24262429

2427-
final class CachedMethodType(paramNames: List[TermName], paramTypes: List[Type])(resultTypeExp: MethodType => Type)
2428-
extends MethodType(paramNames, paramTypes)(resultTypeExp) {
2430+
final class CachedMethodType(paramNames: List[TermName])(paramTypesExp: MethodType => List[Type], resultTypeExp: MethodType => Type)
2431+
extends MethodType(paramNames)(paramTypesExp, resultTypeExp) {
24292432
override def equals(that: Any) = super.equals(that) && that.isInstanceOf[CachedMethodType]
24302433
}
24312434

2432-
final class JavaMethodType(paramNames: List[TermName], paramTypes: List[Type])(resultTypeExp: MethodType => Type)
2433-
extends MethodType(paramNames, paramTypes)(resultTypeExp) {
2435+
final class JavaMethodType(paramNames: List[TermName])(paramTypesExp: MethodType => List[Type], resultTypeExp: MethodType => Type)
2436+
extends MethodType(paramNames)(paramTypesExp, resultTypeExp) {
24342437
override def isJava = true
24352438
override def equals(that: Any) = super.equals(that) && that.isInstanceOf[JavaMethodType]
24362439
override def computeHash = addDelta(super.computeHash, 1)
24372440
override protected def prefixString = "JavaMethodType"
24382441
}
24392442

2440-
final class ImplicitMethodType(paramNames: List[TermName], paramTypes: List[Type])(resultTypeExp: MethodType => Type)
2441-
extends MethodType(paramNames, paramTypes)(resultTypeExp) {
2443+
final class ImplicitMethodType(paramNames: List[TermName])(paramTypesExp: MethodType => List[Type], resultTypeExp: MethodType => Type)
2444+
extends MethodType(paramNames)(paramTypesExp, resultTypeExp) {
24422445
override def isImplicit = true
24432446
override def equals(that: Any) = super.equals(that) && that.isInstanceOf[ImplicitMethodType]
24442447
override def computeHash = addDelta(super.computeHash, 2)
24452448
override protected def prefixString = "ImplicitMethodType"
24462449
}
24472450

24482451
abstract class MethodTypeCompanion {
2449-
def apply(paramNames: List[TermName], paramTypes: List[Type])(resultTypeExp: MethodType => Type)(implicit ctx: Context): MethodType
2452+
def apply(paramNames: List[TermName])(paramTypesExp: MethodType => List[Type], resultTypeExp: MethodType => Type)(implicit ctx: Context): MethodType
2453+
def apply(paramNames: List[TermName], paramTypes: List[Type])(resultTypeExp: MethodType => Type)(implicit ctx: Context): MethodType =
2454+
apply(paramNames)(_ => paramTypes, resultTypeExp)
24502455
def apply(paramNames: List[TermName], paramTypes: List[Type], resultType: Type)(implicit ctx: Context): MethodType =
24512456
apply(paramNames, paramTypes)(_ => resultType)
24522457
def apply(paramTypes: List[Type])(resultTypeExp: MethodType => Type)(implicit ctx: Context): MethodType =
@@ -2484,8 +2489,8 @@ object Types {
24842489
}
24852490

24862491
object MethodType extends MethodTypeCompanion {
2487-
def apply(paramNames: List[TermName], paramTypes: List[Type])(resultTypeExp: MethodType => Type)(implicit ctx: Context) =
2488-
unique(new CachedMethodType(paramNames, paramTypes)(resultTypeExp))
2492+
def apply(paramNames: List[TermName])(paramTypesExp: MethodType => List[Type], resultTypeExp: MethodType => Type)(implicit ctx: Context): MethodType =
2493+
unique(new CachedMethodType(paramNames)(paramTypesExp, resultTypeExp))
24892494

24902495
private type DependencyStatus = Byte
24912496
private final val Unknown: DependencyStatus = 0 // not yet computed
@@ -2497,13 +2502,19 @@ object Types {
24972502
}
24982503

24992504
object JavaMethodType extends MethodTypeCompanion {
2500-
def apply(paramNames: List[TermName], paramTypes: List[Type])(resultTypeExp: MethodType => Type)(implicit ctx: Context) =
2501-
unique(new JavaMethodType(paramNames, paramTypes)(resultTypeExp))
2505+
def apply(paramNames: List[TermName])(paramTypesExp: MethodType => List[Type], resultTypeExp: MethodType => Type)(implicit ctx: Context): MethodType =
2506+
unique(new JavaMethodType(paramNames)(paramTypesExp, resultTypeExp))
25022507
}
25032508

25042509
object ImplicitMethodType extends MethodTypeCompanion {
2505-
def apply(paramNames: List[TermName], paramTypes: List[Type])(resultTypeExp: MethodType => Type)(implicit ctx: Context) =
2506-
unique(new ImplicitMethodType(paramNames, paramTypes)(resultTypeExp))
2510+
def apply(paramNames: List[TermName])(paramTypesExp: MethodType => List[Type], resultTypeExp: MethodType => Type)(implicit ctx: Context): MethodType =
2511+
unique(new ImplicitMethodType(paramNames)(paramTypesExp, resultTypeExp))
2512+
}
2513+
2514+
/** A ternary extractor for MethodType */
2515+
object MethodTpe {
2516+
def unapply(mt: MethodType)(implicit ctx: Context) =
2517+
Some((mt.paramNames, mt.paramTypes, mt.resultType))
25072518
}
25082519

25092520
/** A by-name parameter type of the form `=> T`, or the type of a method with no parameter list. */
@@ -3651,9 +3662,9 @@ object Types {
36513662
this(y, hi)
36523663
}
36533664

3654-
case tp @ MethodType(pnames, ptypes) =>
3665+
case tp: MethodType =>
36553666
variance = -variance
3656-
val y = foldOver(x, ptypes)
3667+
val y = foldOver(x, tp.paramTypes)
36573668
variance = -variance
36583669
this(y, tp.resultType)
36593670

compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,18 +198,18 @@ class ClassfileParser(
198198
*/
199199
def stripOuterParamFromConstructor() = innerClasses.get(currentClassName) match {
200200
case Some(entry) if !isStatic(entry.jflags) =>
201-
val mt @ MethodType(paramnames, paramtypes) = denot.info
202-
denot.info = mt.derivedMethodType(paramnames.tail, paramtypes.tail, mt.resultType)
201+
val mt @ MethodTpe(paramNames, paramTypes, resultType) = denot.info
202+
denot.info = mt.derivedMethodType(paramNames.tail, paramTypes.tail, resultType)
203203
case _ =>
204204
}
205205

206206
/** Make return type of constructor be the enclosing class type,
207207
* and make constructor type polymorphic in the type parameters of the class
208208
*/
209209
def normalizeConstructorInfo() = {
210-
val mt @ MethodType(paramnames, paramtypes) = denot.info
210+
val mt @ MethodType(paramNames) = denot.info
211211
val rt = classRoot.typeRef appliedTo (classRoot.typeParams map (_.typeRef))
212-
denot.info = mt.derivedMethodType(paramnames, paramtypes, rt)
212+
denot.info = mt.derivedMethodType(paramNames, mt.paramTypes, rt)
213213
addConstructorTypeParams(denot)
214214
}
215215

compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ object Scala2Unpickler {
5555
* to `RepeatedParamClass` types.
5656
*/
5757
def arrayToRepeated(tp: Type)(implicit ctx: Context): Type = tp match {
58-
case tp @ MethodType(paramNames, paramTypes) =>
59-
val lastArg = paramTypes.last
58+
case tp: MethodType =>
59+
val lastArg = tp.paramTypes.last
6060
assert(lastArg isRef defn.ArrayClass)
6161
val elemtp0 :: Nil = lastArg.baseArgInfos(defn.ArrayClass)
6262
val elemtp = elemtp0 match {
@@ -66,8 +66,8 @@ object Scala2Unpickler {
6666
elemtp0
6767
}
6868
tp.derivedMethodType(
69-
paramNames,
70-
paramTypes.init :+ defn.RepeatedParamType.appliedTo(elemtp),
69+
tp.paramNames,
70+
tp.paramTypes.init :+ defn.RepeatedParamType.appliedTo(elemtp),
7171
tp.resultType)
7272
case tp: PolyType =>
7373
tp.derivedPolyType(tp.paramNames, tp.paramBounds, arrayToRepeated(tp.resultType))

compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ private class ExtractAPICollector(implicit val ctx: Context) extends ThunkHolder
284284
case pt: PolyType =>
285285
assert(start == 0)
286286
paramLists(pt.resultType)
287-
case mt @ MethodType(pnames, ptypes) =>
287+
case mt @ MethodTpe(pnames, ptypes, restpe) =>
288288
// TODO: We shouldn't have to work so hard to find the default parameters
289289
// of a method, Dotty should expose a convenience method for that, see #1143
290290
val defaults =
@@ -300,7 +300,7 @@ private class ExtractAPICollector(implicit val ctx: Context) extends ThunkHolder
300300
val params = (pnames, ptypes, defaults).zipped.map((pname, ptype, isDefault) =>
301301
new api.MethodParameter(pname.toString, apiType(ptype),
302302
isDefault, api.ParameterModifier.Plain))
303-
new api.ParameterList(params.toArray, mt.isImplicit) :: paramLists(mt.resultType, params.length)
303+
new api.ParameterList(params.toArray, mt.isImplicit) :: paramLists(restpe, params.length)
304304
case _ =>
305305
Nil
306306
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class CollectEntryPoints extends MiniPhaseTransform {
6464
val hasApproximate = possibles exists {
6565
m =>
6666
m.info match {
67-
case MethodType(_, p :: Nil) =>
67+
case MethodTpe(_, p :: Nil, _) =>
6868
p.typeSymbol == defn.ArrayClass
6969
case _ => false
7070
}
@@ -87,8 +87,8 @@ class CollectEntryPoints extends MiniPhaseTransform {
8787
m.symbol.info match {
8888
case t: PolyType =>
8989
fail("main methods cannot be generic.")
90-
case t@MethodType(paramNames, paramTypes) =>
91-
if (t.resultType :: paramTypes exists (_.typeSymbol.isAbstractType))
90+
case t: MethodType =>
91+
if (t.resultType :: t.paramTypes exists (_.typeSymbol.isAbstractType))
9292
fail("main methods cannot refer to type parameters or abstract types.", m.symbol.pos)
9393
else
9494
javaPlatform.isJavaMainMethod(m.symbol) || fail("main method must have exact signature (Array[String])Unit", m.symbol.pos)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ class ElimByName extends MiniPhaseTransform with InfoTransformer { thisTransform
9292
arg
9393
}
9494

95-
val MethodType(_, formals) = tree.fun.tpe.widen
96-
val args1 = tree.args.zipWithConserve(formals)(transformArg)
95+
val mt @ MethodType(_) = tree.fun.tpe.widen
96+
val args1 = tree.args.zipWithConserve(mt.paramTypes)(transformArg)
9797
cpy.Apply(tree)(tree.fun, args1)
9898
}
9999

0 commit comments

Comments
 (0)