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