mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Diagnose invalid @_hasStorage attributes
A bug in `@objc @implementation` is causing incorrect `@_hasStorage` attributes to be printed into module interfaces. As an initial step towards fixing this, diagnose bad `@_hasStorage` attributes and treat them as computed properties so that these malformed interfaces don’t cause compiler crashes. Partially fixes rdar://144811653.
This commit is contained in:
10
test/ModuleInterface/has_storage_attr_bad.swiftinterface
Normal file
10
test/ModuleInterface/has_storage_attr_bad.swiftinterface
Normal file
@@ -0,0 +1,10 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-module-flags:
|
||||
// expected-error@-2 {{failed to verify module interface of 'Test' due to the errors above}}
|
||||
|
||||
// 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-error {{'@_hasStorage' attribute cannot be applied to declaration in extension}}
|
||||
}
|
||||
Reference in New Issue
Block a user