@@ -2242,13 +2242,13 @@ getImportTypeKindForParam(const clang::ParmVarDecl *param) {
2242
2242
}
2243
2243
2244
2244
Optional<swift::Type> ClangImporter::Implementation::importParameterType (
2245
- const clang::ParmVarDecl *param, OptionalTypeKind OptionalityOfParam ,
2245
+ const clang::ParmVarDecl *param, OptionalTypeKind optionalityOfParam ,
2246
2246
bool allowNSUIntegerAsInt, bool isNSDictionarySubscriptGetter,
2247
2247
bool paramIsError, bool paramIsCompletionHandler,
2248
2248
Optional<unsigned > completionHandlerErrorParamIndex,
2249
2249
ArrayRef<GenericTypeParamDecl *> genericParams,
2250
- llvm::function_ref<void (Diagnostic &&)> paramAddDiag, bool &isInOut ,
2251
- bool &isParamTypeImplicitlyUnwrapped) {
2250
+ llvm::function_ref<void (Diagnostic &&)> addImportDiagnosticFn ,
2251
+ bool &isInOut, bool & isParamTypeImplicitlyUnwrapped) {
2252
2252
auto paramTy = param->getType ();
2253
2253
2254
2254
ImportTypeKind importKind = getImportTypeKindForParam (param);
@@ -2282,7 +2282,7 @@ Optional<swift::Type> ClangImporter::Implementation::importParameterType(
2282
2282
? PTK_UnsafePointer
2283
2283
: PTK_UnsafeMutablePointer;
2284
2284
auto genericType = findGenericTypeInGenericDecls (
2285
- *this , templateParamType, genericParams, attrs, paramAddDiag );
2285
+ *this , templateParamType, genericParams, attrs, addImportDiagnosticFn );
2286
2286
swiftParamTy = genericType->wrapInPointer (pointerKind);
2287
2287
if (!swiftParamTy)
2288
2288
return None;
@@ -2291,13 +2291,13 @@ Optional<swift::Type> ClangImporter::Implementation::importParameterType(
2291
2291
auto templateParamType =
2292
2292
cast<clang::TemplateTypeParmType>(paramTy->getPointeeType ());
2293
2293
swiftParamTy = findGenericTypeInGenericDecls (
2294
- *this , templateParamType, genericParams, attrs, paramAddDiag );
2294
+ *this , templateParamType, genericParams, attrs, addImportDiagnosticFn );
2295
2295
if (!paramTy->getPointeeType ().isConstQualified ())
2296
2296
isInOut = true ;
2297
2297
} else if (auto *templateParamType =
2298
2298
dyn_cast<clang::TemplateTypeParmType>(paramTy)) {
2299
2299
swiftParamTy = findGenericTypeInGenericDecls (
2300
- *this , templateParamType, genericParams, attrs, paramAddDiag );
2300
+ *this , templateParamType, genericParams, attrs, addImportDiagnosticFn );
2301
2301
} else if (auto refType = dyn_cast<clang::ReferenceType>(paramTy)) {
2302
2302
// We don't support reference type to a dependent type, just bail.
2303
2303
if (refType->getPointeeType ()->isDependentType ()) {
@@ -2317,11 +2317,11 @@ Optional<swift::Type> ClangImporter::Implementation::importParameterType(
2317
2317
return None;
2318
2318
2319
2319
swiftParamTy = ExistentialType::get (nsCopying);
2320
- if (OptionalityOfParam != OTK_None)
2320
+ if (optionalityOfParam != OTK_None)
2321
2321
swiftParamTy = OptionalType::get (swiftParamTy);
2322
2322
2323
2323
isParamTypeImplicitlyUnwrapped =
2324
- OptionalityOfParam == OTK_ImplicitlyUnwrappedOptional;
2324
+ optionalityOfParam == OTK_ImplicitlyUnwrappedOptional;
2325
2325
}
2326
2326
2327
2327
if (!swiftParamTy) {
@@ -2339,11 +2339,11 @@ Optional<swift::Type> ClangImporter::Implementation::importParameterType(
2339
2339
// for the specific case when the throws conversion works, but is not
2340
2340
// sufficient if it fails. (The correct, overarching fix is ClangImporter
2341
2341
// being lazier.)
2342
- auto importedType =
2343
- importType (paramTy, importKind, paramAddDiag, allowNSUIntegerAsInt,
2344
- Bridgeability::Full, attrs, OptionalityOfParam ,
2345
- /* resugarNSErrorPointer=*/ !paramIsError,
2346
- completionHandlerErrorParamIndex);
2342
+ auto importedType = importType (paramTy, importKind, addImportDiagnosticFn,
2343
+ allowNSUIntegerAsInt, Bridgeability::Full ,
2344
+ attrs, optionalityOfParam ,
2345
+ /* resugarNSErrorPointer=*/ !paramIsError,
2346
+ completionHandlerErrorParamIndex);
2347
2347
if (!importedType)
2348
2348
return None;
2349
2349
@@ -2404,15 +2404,16 @@ ParameterList *ClangImporter::Implementation::importFunctionParameterList(
2404
2404
knownNonNull |= clangDecl->isFunctionTemplateSpecialization ();
2405
2405
2406
2406
// Check nullability of the parameter.
2407
- OptionalTypeKind OptionalityOfParam = getParamOptionality (param, knownNonNull);
2407
+ OptionalTypeKind optionalityOfParam =
2408
+ getParamOptionality (param, knownNonNull);
2408
2409
2409
2410
ImportDiagnosticAdder paramAddDiag (*this , clangDecl, param->getLocation ());
2410
2411
2411
2412
bool isInOut = false ;
2412
2413
bool isParamTypeImplicitlyUnwrapped = false ;
2413
2414
2414
2415
auto swiftParamTyOpt = importParameterType (
2415
- param, OptionalityOfParam , allowNSUIntegerAsInt,
2416
+ param, optionalityOfParam , allowNSUIntegerAsInt,
2416
2417
/* isNSDictionarySubscriptGetter=*/ false ,
2417
2418
/* paramIsError=*/ false ,
2418
2419
/* paramIsCompletionHandler=*/ false ,
0 commit comments