mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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.
38 lines
981 B
Swift
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()'}}
|
|
}
|