@@ -702,24 +702,41 @@ class Setup extends PreRecheck, SymTransformer, SetupAPI:
702702 if prevLambdas.isEmpty then resType
703703 else SubstParams (prevPsymss, prevLambdas)(resType)
704704
705+ def paramsToCap (mt : Type )(using Context ): Type = mt match
706+ case mt : MethodType =>
707+ mt.derivedLambdaType(
708+ paramInfos = mt.paramInfos.map(root.freshToCap),
709+ resType = paramsToCap(mt.resType))
710+ case mt : PolyType =>
711+ mt.derivedLambdaType(resType = paramsToCap(mt.resType))
712+ case _ => mt
713+
705714 // If there's a change in the signature, update the info of `sym`
706715 if sym.exists && signatureChanges then
707716 val updatedInfo =
708717 if ccConfig.newScheme then
709- def newInfo = root.toResultInResults(report.error(_, tree.srcPos)):
710- if sym.is(Method ) then methodType(sym.paramSymss, localReturnType)
711- else tree.tpt.nuType
718+ val paramSymss = sym.paramSymss
719+ def newInfo (using Context ) = // will be run in this or next phase
720+ root.toResultInResults(report.error(_, tree.srcPos)):
721+ if sym.is(Method ) then
722+ paramsToCap(methodType(paramSymss, localReturnType))
723+ else tree.tpt.nuType
712724 if tree.tpt.isInstanceOf [InferredTypeTree ]
713725 && ! sym.is(Param ) && ! sym.is(ParamAccessor )
714726 then
715727 val prevInfo = sym.info
716728 new LazyType :
717729 def complete (denot : SymDenotation )(using Context ) =
718730 assert(ctx.phase == thisPhase.next, i " $sym" )
719- capt.println(i " forcing $sym, printing = ${ctx.mode.is(Mode .Printing )}" )
720731 sym.info = prevInfo // set info provisionally so we can analyze the symbol in recheck
721732 completeDef(tree, sym, this )
722733 sym.info = newInfo
734+ .showing(i " new info of $sym = $result" , capt)
735+ else if sym.is(Method ) then
736+ new LazyType :
737+ def complete (denot : SymDenotation )(using Context ) =
738+ sym.info = newInfo
739+ .showing(i " new info of $sym = $result" , capt)
723740 else newInfo
724741 else
725742 val newInfo =
0 commit comments