@@ -248,7 +248,7 @@ object ProtoTypes {
248
248
* [](args): resultType
249
249
*/
250
250
case class FunProto (args : List [untpd.Tree ], resType : Type )(typer : Typer ,
251
- override val isUsingApply : Boolean , state : FunProtoState = new FunProtoState )(implicit val ctx : Context )
251
+ override val isUsingApply : Boolean , state : FunProtoState = new FunProtoState )(implicit protoCtx : Context )
252
252
extends UncachedGroundType with ApplyingProto with FunOrPolyProto {
253
253
override def resultType (implicit ctx : Context ): Type = resType
254
254
@@ -310,18 +310,18 @@ object ProtoTypes {
310
310
def typedArgs (norm : (untpd.Tree , Int ) => untpd.Tree = sameTree)(implicit ctx : Context ): List [Tree ] =
311
311
if (state.typedArgs.size == args.length) state.typedArgs
312
312
else {
313
- val prevConstraint = this .ctx .typerState.constraint
313
+ val prevConstraint = protoCtx .typerState.constraint
314
314
315
315
try {
316
- implicit val ctx = this .ctx
316
+ implicit val ctx = protoCtx
317
317
val args1 = args.mapWithIndexConserve((arg, idx) =>
318
318
cacheTypedArg(arg, arg => typer.typed(norm(arg, idx)), force = false ))
319
319
if (! args1.exists(arg => isUndefined(arg.tpe))) state.typedArgs = args1
320
320
args1
321
321
}
322
322
finally
323
- if (this .ctx .typerState.constraint ne prevConstraint)
324
- ctx.typerState.mergeConstraintWith(this .ctx .typerState)
323
+ if (protoCtx .typerState.constraint ne prevConstraint)
324
+ ctx.typerState.mergeConstraintWith(protoCtx .typerState)
325
325
}
326
326
327
327
/** Type single argument and remember the unadapted result in `myTypedArg`.
@@ -386,7 +386,7 @@ object ProtoTypes {
386
386
override def deepenProto (implicit ctx : Context ): FunProto = derivedFunProto(args, resultType.deepenProto, typer)
387
387
388
388
override def withContext (newCtx : Context ): ProtoType =
389
- if ( newCtx `eq` ctx) this
389
+ if newCtx `eq` protoCtx then this
390
390
else new FunProto (args, resType)(typer, isUsingApply, state)(newCtx)
391
391
}
392
392
0 commit comments