@@ -56,25 +56,18 @@ static FuncDecl *deriveDistributedActor_resolve(DerivedConformance &derived) {
5656 assert (decl->isDistributedActor ());
5757 auto &C = decl->getASTContext ();
5858
59- auto mkParam = [&](Identifier argName, Identifier paramName, Type ty) -> ParamDecl* {
60- auto *param = new (C) ParamDecl (SourceLoc (),
61- SourceLoc (), argName,
62- SourceLoc (), paramName, decl);
63- param->setImplicit ();
64- param->setSpecifier (ParamSpecifier::Default);
65- param->setInterfaceType (ty);
66- return param;
67- };
68-
6959 auto idType = getDistributedActorIDType (decl);
7060 auto actorSystemType = getDistributedActorSystemType (decl);
7161
7262 // (id: Self.ID, using system: Self.ActorSystem)
7363 auto *params = ParameterList::create (
7464 C,
7565 /* LParenLoc=*/ SourceLoc (),
76- /* params=*/ { mkParam (C.Id_id , C.Id_id , idType),
77- mkParam (C.Id_using , C.Id_system , actorSystemType)
66+ /* params=*/ {
67+ ParamDecl::createImplicit (
68+ C, C.Id_id , C.Id_id , idType, decl),
69+ ParamDecl::createImplicit (
70+ C, C.Id_using , C.Id_system , actorSystemType, decl)
7871 },
7972 /* RParenLoc=*/ SourceLoc ()
8073 );
@@ -364,16 +357,6 @@ static FuncDecl *deriveDistributedActorSystem_invokeHandlerOnReturn(
364357 auto system = derived.Nominal ;
365358 auto &C = system->getASTContext ();
366359
367- auto mkParam = [&](Identifier argName, Identifier paramName,
368- Type ty) -> ParamDecl * {
369- auto *param = new (C) ParamDecl (SourceLoc (), SourceLoc (), argName,
370- SourceLoc (), paramName, system);
371- param->setImplicit ();
372- param->setSpecifier (ParamSpecifier::Default);
373- param->setInterfaceType (ty);
374- return param;
375- };
376-
377360 // auto serializationRequirementType = getDistributedActorSystemType(decl);
378361 auto resultHandlerType = getDistributedActorSystemResultHandlerType (system);
379362 auto unsafeRawPointerType = C.getUnsafeRawPointerType ();
@@ -390,10 +373,17 @@ static FuncDecl *deriveDistributedActorSystem_invokeHandlerOnReturn(
390373 C,
391374 /* LParenLoc=*/ SourceLoc (),
392375 /* params=*/
393- {mkParam (C.Id_handler , C.Id_handler ,
394- system->mapTypeIntoContext (resultHandlerType)),
395- mkParam (C.Id_resultBuffer , C.Id_resultBuffer , unsafeRawPointerType),
396- mkParam (C.Id_metatype , C.Id_metatype , anyTypeType)},
376+ {
377+ ParamDecl::createImplicit (
378+ C, C.Id_handler , C.Id_handler ,
379+ system->mapTypeIntoContext (resultHandlerType), system),
380+ ParamDecl::createImplicit (
381+ C, C.Id_resultBuffer , C.Id_resultBuffer ,
382+ unsafeRawPointerType, system),
383+ ParamDecl::createImplicit (
384+ C, C.Id_metatype , C.Id_metatype ,
385+ anyTypeType, system)
386+ },
397387 /* RParenLoc=*/ SourceLoc ());
398388
399389 // Func name: invokeHandlerOnReturn(handler:resultBuffer:metatype)
0 commit comments