Merge pull request #80360 from beccadax/rdar144811653

This commit is contained in:
Becca Royal-Gordon
2025-03-28 19:01:01 -07:00
committed by GitHub
9 changed files with 56 additions and 14 deletions

View File

@@ -0,0 +1,9 @@
// swift-interface-format-version: 1.0
// swift-module-flags:
// RUN: %target-swift-typecheck-module-from-interface(%s) -module-name Test -verify -verify-ignore-unknown
// REQUIRES: OS=macosx
extension Array {
@_hasStorage public var foo: Int { get set } // expected-warning {{'@_hasStorage' attribute cannot be applied to declaration in extension}}
}

View File

@@ -21,6 +21,9 @@ import Foundation
// @objc should be omitted on extensions
// NEGATIVE-NOT: @objc{{.*}} extension
// Stored properties in objcImpl extensions shouldn't have @_hasStorage
// NEGATIVE-NOT: @_hasStorage
//
// @_objcImplementation class
//
@@ -42,6 +45,11 @@ import Foundation
// CHECK-DAG: final public var implProperty2: ObjectiveC.NSObject? { get set }
public final var implProperty2: NSObject?
// CHECK-DAG: final public var implProperty3: ObjectiveC.NSObject? {
public final var implProperty3: NSObject? {
didSet { }
}
// CHECK-NOT: func mainMethod
@objc public func mainMethod(_: Int32) { print(implProperty) }