mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Un-reverts 9c01ee2c1b.
Also, add myself as a reviewer for more availability related files.
NFC.
38 lines
951 B
Swift
38 lines
951 B
Swift
// RUN: %target-typecheck-verify-swift
|
|
|
|
// REQUIRES: OS=macosx
|
|
|
|
struct A {} // expected-note * {{found this candidate}}
|
|
struct B {} // expected-note * {{found this candidate}}
|
|
|
|
func ambiguousInFarFuture(_: A) {}
|
|
|
|
@available(macOS 99, *)
|
|
func ambiguousInFarFuture(_: B) {}
|
|
|
|
struct S {
|
|
func ambiguousInFarFuture(_: A) {}
|
|
}
|
|
|
|
@available(macOS 99, *)
|
|
extension S {
|
|
func ambiguousInFarFuture(_: B) {}
|
|
}
|
|
|
|
func testDeploymentTarget(_ s: S) {
|
|
ambiguousInFarFuture(.init())
|
|
s.ambiguousInFarFuture(.init())
|
|
}
|
|
|
|
@available(macOS 99, *)
|
|
func testFarFuture(_ s: S) {
|
|
ambiguousInFarFuture(.init()) // expected-error {{ambiguous use of 'init()'}}
|
|
s.ambiguousInFarFuture(.init()) // expected-error {{ambiguous use of 'init()'}}
|
|
}
|
|
|
|
@available(macOS, unavailable)
|
|
func testUnavailable(_ s: S) {
|
|
ambiguousInFarFuture(.init()) // expected-error {{ambiguous use of 'init()'}}
|
|
s.ambiguousInFarFuture(.init()) // expected-error {{ambiguous use of 'init()'}}
|
|
}
|