mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Replace the `here` part of the generic exportability diagnostic for variables with: `in a property declaration marked public or in a '@frozen' or '@usableFromInline' context`. The full diagnostic now looks like: ``` error: cannot use struct 'ImportedType' in a property declaration marked public or in a '@frozen' or '@usableFromInline' context; 'HiddenDependency' has been imported as implementation-only ``` This should be improved further to support implicitly exported memory layouts in non-library-evolution and embedded.
24 lines
726 B
Swift
24 lines
726 B
Swift
// REQUIRES: OS=macosx
|
|
// RUN: %target-typecheck-verify-swift -library-level api
|
|
|
|
@_spi_available(macOS 10.10, *)
|
|
@available(iOS 8.0, *)
|
|
public protocol MacOSSPIProto {} // expected-note {{protocol declared here}}
|
|
|
|
@_spi_available(iOS 8.0, *)
|
|
@available(macOS 10.10, *)
|
|
public protocol iOSSPIProto {}
|
|
|
|
@_spi_available(macOS 10.10, *)
|
|
@available(iOS 8.0, *)
|
|
public class Bar {
|
|
public var macos: MacOSSPIProto?
|
|
public var ios: iOSSPIProto?
|
|
}
|
|
|
|
@available(macOS 10.10, iOS 8.0, *)
|
|
public class Baz {
|
|
public var macos: MacOSSPIProto? // expected-error {{cannot use protocol 'MacOSSPIProto' in a property declaration marked public or in a '@frozen' or '@usableFromInline' context; it is SPI}}
|
|
public var ios: iOSSPIProto?
|
|
}
|