mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #80360 from beccadax/rdar144811653
This commit is contained in:
9
test/ModuleInterface/has_storage_attr_bad.swiftinterface
Normal file
9
test/ModuleInterface/has_storage_attr_bad.swiftinterface
Normal 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}}
|
||||
}
|
||||
@@ -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) }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user