Skip to content

Commit 64e9d0b

Browse files
authored
Merge pull request #42275 from CodaFi/copy-constructor
Restore Prior Behavior for NSCopying Lookup in Subscript Type Mapping
2 parents 4ecc05d + a22f57b commit 64e9d0b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/ClangImporter/ImportType.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2817,9 +2817,10 @@ ImportedType ClangImporter::Implementation::importMethodParamsAndReturnType(
28172817
if (kind == SpecialMethodKind::NSDictionarySubscriptGetter &&
28182818
paramTy->isObjCIdType()) {
28192819
// Not using `getImportTypeAttrs()` is unprincipled but OK for this hack.
2820-
swiftParamTy = ExistentialType::get(SwiftContext.getNSCopyingType());
2821-
if (!swiftParamTy)
2820+
auto nsCopying = SwiftContext.getNSCopyingType();
2821+
if (!nsCopying)
28222822
return {Type(), false};
2823+
swiftParamTy = ExistentialType::get(nsCopying);
28232824
if (optionalityOfParam != OTK_None)
28242825
swiftParamTy = OptionalType::get(swiftParamTy);
28252826

0 commit comments

Comments
 (0)