ASTPrinter: Fix printing of let properties inside @objc @implementation extensions

A `let` here is really just a `var` with a `{ get }`.

Fixes rdar://problem/127120469.
This commit is contained in:
Slava Pestov
2025-06-05 22:52:46 -04:00
parent ed8d696395
commit 2c53876c19
3 changed files with 15 additions and 6 deletions

View File

@@ -4,6 +4,7 @@
- (nonnull instancetype)init;
@property (readonly) int letProperty1;
@property (assign) int implProperty;
- (void)mainMethod:(int)param;

View File

@@ -42,6 +42,12 @@ import Foundation
didSet { print(implProperty) }
}
// CHECK-NOT: var letProperty1:
@objc public let letProperty1: Int32
// CHECK-DAG: @nonobjc public var letProperty2: Swift.Int32 { get }
@nonobjc public let letProperty2: Int32
// CHECK-DAG: final public var implProperty2: ObjectiveC.NSObject? { get set }
public final var implProperty2: NSObject?