@@ -129,25 +129,24 @@ class Bridges(root: ClassSymbol, thisPhase: DenotTransformer)(using Context) {
129
129
assert(ctx.typer.isInstanceOf [Erasure .Typer ])
130
130
ctx.typer.typed(untpd.cpy.Apply (ref)(ref, args), member.info.finalResultType)
131
131
else
132
- val defn .ContextFunctionType (argTypes, resType, erasedParams) = tp : @ unchecked
133
- val anonFun = newAnonFun(ctx.owner,
134
- MethodType (
135
- argTypes.zip(erasedParams.padTo(argTypes.length, false ))
136
- .flatMap((t, e) => if e then None else Some (t)),
137
- resType),
138
- coord = ctx.owner.coord)
132
+ val mtWithoutErasedParams = atPhase(erasurePhase) {
133
+ val defn .ContextFunctionType (argTypes, resType, erasedParams) = tp.dealias: @ unchecked
134
+ val paramInfos = argTypes.zip(erasedParams).collect { case (argType, erased) if ! erased => argType }
135
+ MethodType (paramInfos, resType)
136
+ }
137
+ val anonFun = newAnonFun(ctx.owner, mtWithoutErasedParams, coord = ctx.owner.coord)
139
138
anonFun.info = transformInfo(anonFun, anonFun.info)
140
139
141
140
def lambdaBody (refss : List [List [Tree ]]) =
142
141
val refs :: Nil = refss : @ unchecked
143
142
val expandedRefs = refs.map(_.withSpan(ctx.owner.span.endPos)) match
144
143
case (bunchedParam @ Ident (nme.ALLARGS )) :: Nil =>
145
- argTypes .indices.toList.map(n =>
144
+ mtWithoutErasedParams.paramInfos .indices.toList.map(n =>
146
145
bunchedParam
147
146
.select(nme.primitive.arrayApply)
148
147
.appliedTo(Literal (Constant (n))))
149
148
case refs1 => refs1
150
- expand(args ::: expandedRefs, resType, n - 1 )(using ctx.withOwner(anonFun))
149
+ expand(args ::: expandedRefs, mtWithoutErasedParams. resType, n - 1 )(using ctx.withOwner(anonFun))
151
150
152
151
val unadapted = Closure (anonFun, lambdaBody)
153
152
cpy.Block (unadapted)(unadapted.stats,
0 commit comments