[TypeChecker] Extend test-case for rdar://problem/39401774
Add generic and non-generic method resolution ambiguities.
diff --git a/test/Constraints/rdar39401774.swift b/test/Constraints/rdar39401774.swift
index 9b31a97..1f79311 100644
--- a/test/Constraints/rdar39401774.swift
+++ b/test/Constraints/rdar39401774.swift
@@ -1,20 +1,26 @@
// RUN: %target-typecheck-verify-swift
-class A {
- var foo: Int? { return 42 } // expected-note {{found this candidate}}
+class A<T> {
+ var foo: Int? { return 42 } // expected-note {{found this candidate}}
+ func baz() -> T { fatalError() } // expected-note {{found this candidate}}
+ func fiz() -> Int { return 42 } // expected-note {{found this candidate}}
}
protocol P1 {
+ associatedtype T
var foo: Int? { get } // expected-note {{found this candidate}}
+ func baz() -> T // expected-note {{found this candidate}}
+ func fiz() -> Int // expected-note {{found this candidate}}
}
protocol P2 : P1 {
var bar: Int? { get }
}
-extension P2 where Self: A {
+extension P2 where Self: A<Int> {
var bar: Int? {
guard let foo = foo else { return 0 } // expected-error {{ambiguous use of 'foo'}}
- return foo
+ let _ = baz() // expected-error {{ambiguous use of 'baz()'}}
+ return fiz() // expected-error {{ambiguous use of 'fiz()'}}
}
}