mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Suppression of diagnostics about use of unavailable declarations in equivalently unavailable contexts now relies on querying the `TypeRefinementContext` hierarchy. Generation of the TypeRefinementContext tree was suppressed when `-disable-availability-checking` was specified, though, causing some unavailability diagnostics to be emitted when they ought to be suppressed. Instead of refusing to generate a `TypeRefinementContext` hierarchy, instead just avoid populating nodes for `if #available` checks for OS versions since these checks are meant to have no effect when `-disable-availability-checking` is specified. Resolves rdar://138987918.
14 lines
609 B
Swift
14 lines
609 B
Swift
// RUN: %target-swift-frontend -emit-module %s -enable-library-evolution -swift-version 5 -module-name Library -emit-module-interface-path %t/Library.swiftinterface -o %t/Library.swiftmodule
|
|
|
|
// RUN: echo "import Library" > %t/Client.swift
|
|
// RUN: %target-swift-frontend -emit-module %t/Client.swift -module-name Client -o %t/Client.swiftmodule -I %t
|
|
|
|
// RUN: rm %t/Library.swiftmodule
|
|
// RUN: %target-sil-opt -enable-sil-verify-all %t/Client.swiftmodule -module-name Client
|
|
|
|
@available(*, unavailable)
|
|
public struct Unavailable {}
|
|
|
|
@available(*, unavailable)
|
|
public func usesUnavailable(_ u: Unavailable) {}
|