Files
swift-mirror/test/ModuleInterface/has_storage_attr_bad.swiftinterface
Becca Royal-Gordon c44284d874 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.
2025-03-27 16:24:44 -07:00

11 lines
447 B
Plaintext

// 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}}
}