Files
swift-mirror/test/Availability/availability_macos.swift
Kathy Gray 97dfc82255 Update tests to reflect type information in ambiguity resolution
All but 7 tests now passing. Those 7 tests either do not refer to these circumstances or do not seem to pass even when modified to accept type specifications.
2025-10-10 17:46:22 +01:00

38 lines
981 B
Swift

// RUN: %target-typecheck-verify-swift
// REQUIRES: OS=macosx
struct A {} // expected-note * {{found candidate with type '() -> A'}}
struct B {} // expected-note * {{found candidate with type '() -> B'}}
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()'}}
}