mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Suggesting the addition of an `@available` attribute on Linux and Windows is inapprorpriate given that Swift is not ABI stable on those platforms. Resolves rdar://107387133
23 lines
667 B
Swift
23 lines
667 B
Swift
// Test that the -require-explicit-availability flag does not cause diagnostics
|
|
// to be emitted on platforms where versioned availability annotations are not
|
|
// meaningful.
|
|
|
|
// RUN: %target-swift-frontend -typecheck -parse-as-library -verify %s -require-explicit-availability=error
|
|
|
|
// Currently versioned availability should only be required on Apple platforms.
|
|
// UNSUPPORTED: VENDOR=apple
|
|
|
|
public struct NoAvailabilityStruct {
|
|
public func method() { }
|
|
}
|
|
|
|
@available(*, unavailable)
|
|
public struct UnavailableStruct {
|
|
public func okMethod() { }
|
|
}
|
|
|
|
public func noAvailabilityFunc() { }
|
|
|
|
@available(SwiftStdlib 5.9, *)
|
|
public func stdlib5_9AvailabilityFunc() { }
|