Skip to content

[5.9] Correctly print swift Int property as NSUInteger when it overrides an NSUInteger objc property. #66052

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/PrintAsClang/DeclAndTypePrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,9 @@ class DeclAndTypePrinter::Implementation

/// Returns true if \p clangTy is the typedef for NSUInteger.
bool isNSUInteger(clang::QualType clangTy) {
if (const auto* elaboratedTy = dyn_cast<clang::ElaboratedType>(clangTy)) {
clangTy = elaboratedTy->desugar();
}
const auto *typedefTy = dyn_cast<clang::TypedefType>(clangTy);
if (!typedefTy)
return false;
Expand Down
2 changes: 0 additions & 2 deletions test/PrintAsObjC/availability-real-sdk.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@
// CHECK-NEXT: - (nullable instancetype)initWithCoder:(NSCoder * _Nonnull){{[a-zA-Z]+}} OBJC_DESIGNATED_INITIALIZER;
// CHECK-NEXT: @end

// REQUIRES: rdar102629628

import Foundation


Expand Down
2 changes: 0 additions & 2 deletions test/PrintAsObjC/override.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@

// REQUIRES: objc_interop

// REQUIRES: rdar102629628

import OverrideBase
// No errors from Clang until we get to the FixMe class.
// CLANG-NOT: error
Expand Down