Skip to content

Commit c6d5216

Browse files
authored
Merge pull request #66011 from thunderseethe/fix-print-objc-nsuint
Correctly print swift `Int` property as `NSUInteger` when it overrides an `NSUInteger` objc property.
2 parents 570c364 + d9dcf06 commit c6d5216

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

lib/PrintAsClang/DeclAndTypePrinter.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,9 @@ class DeclAndTypePrinter::Implementation
959959

960960
/// Returns true if \p clangTy is the typedef for NSUInteger.
961961
bool isNSUInteger(clang::QualType clangTy) {
962+
if (const auto* elaboratedTy = dyn_cast<clang::ElaboratedType>(clangTy)) {
963+
clangTy = elaboratedTy->desugar();
964+
}
962965
const auto *typedefTy = dyn_cast<clang::TypedefType>(clangTy);
963966
if (!typedefTy)
964967
return false;

test/PrintAsObjC/availability-real-sdk.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@
4949
// CHECK-NEXT: - (nullable instancetype)initWithCoder:(NSCoder * _Nonnull){{[a-zA-Z]+}} OBJC_DESIGNATED_INITIALIZER;
5050
// CHECK-NEXT: @end
5151

52-
// REQUIRES: rdar102629628
53-
5452
import Foundation
5553

5654

test/PrintAsObjC/override.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515

1616
// REQUIRES: objc_interop
1717

18-
// REQUIRES: rdar102629628
19-
2018
import OverrideBase
2119
// No errors from Clang until we get to the FixMe class.
2220
// CLANG-NOT: error

0 commit comments

Comments
 (0)