Files
swift-mirror/test/attr/require_explicit_availability_non_darwin.swift
Allan Shortlidge 93a96e81c2 Sema: Suppress explicit availability diagnostics on non-Darwin targets.
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
2023-05-08 14:53:12 -07:00

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() { }