@@ -193,58 +193,13 @@ BridgedParamDecl BridgedParamDecl_createParsed(
193193 BridgedASTContext cContext, BridgedDeclContext cDeclContext,
194194 BridgedSourceLoc cSpecifierLoc, BridgedIdentifier cArgName,
195195 BridgedSourceLoc cArgNameLoc, BridgedIdentifier cParamName,
196- BridgedSourceLoc cParamNameLoc, BridgedNullableTypeRepr opaqueType,
197- BridgedNullableExpr cDefaultArgument,
196+ BridgedSourceLoc cParamNameLoc, BridgedNullableExpr cDefaultArgument,
198197 BridgedNullableDefaultArgumentInitializer cDefaultArgumentInitContext) {
199- auto *paramDecl = ParamDecl::createParsed (
198+ return ParamDecl::createParsed (
200199 cContext.unbridged (), cSpecifierLoc.unbridged (), cArgNameLoc.unbridged (),
201200 cArgName.unbridged (), cParamNameLoc.unbridged (), cParamName.unbridged (),
202201 cDefaultArgument.unbridged (), cDefaultArgumentInitContext.unbridged (),
203202 cDeclContext.unbridged ());
204-
205- if (auto type = opaqueType.unbridged ()) {
206- paramDecl->setTypeRepr (type);
207-
208- // FIXME: Copied from 'Parser::parsePattern()'. This should be in Sema.
209- // Dig through the type to find any attributes or modifiers that are
210- // associated with the type but should also be reflected on the
211- // declaration.
212- auto unwrappedType = type;
213- while (true ) {
214- if (auto *ATR = dyn_cast<AttributedTypeRepr>(unwrappedType)) {
215- auto attrs = ATR->getAttrs ();
216- // At this point we actually don't know if that's valid to mark
217- // this parameter declaration as `autoclosure` because type has
218- // not been resolved yet - it should either be a function type
219- // or typealias with underlying function type.
220- bool autoclosure = llvm::any_of (attrs, [](TypeOrCustomAttr attr) {
221- if (auto typeAttr = attr.dyn_cast <TypeAttribute *>())
222- return isa<AutoclosureTypeAttr>(typeAttr);
223- return false ;
224- });
225- paramDecl->setAutoClosure (autoclosure);
226-
227- unwrappedType = ATR->getTypeRepr ();
228- continue ;
229- }
230-
231- if (auto *STR = dyn_cast<SpecifierTypeRepr>(unwrappedType)) {
232- if (isa<IsolatedTypeRepr>(STR))
233- paramDecl->setIsolated (true );
234- else if (isa<CompileTimeConstTypeRepr>(STR))
235- paramDecl->setCompileTimeConst (true );
236- else if (isa<SendingTypeRepr>(STR))
237- paramDecl->setSending (true );
238-
239- unwrappedType = STR->getBase ();
240- continue ;
241- }
242-
243- break ;
244- }
245- }
246-
247- return paramDecl;
248203}
249204
250205void BridgedConstructorDecl_setParsedBody (BridgedConstructorDecl decl,
0 commit comments