File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 1
1
// RUN: %target-typecheck-verify-swift
2
2
3
- class A {
4
- var foo : Int ? { return 42 } // expected-note {{found this candidate}}
3
+ class A < T> {
4
+ var foo : Int ? { return 42 } // expected-note {{found this candidate}}
5
+ func baz( ) -> T { fatalError ( ) } // expected-note {{found this candidate}}
6
+ func fiz( ) -> Int { return 42 } // expected-note {{found this candidate}}
5
7
}
6
8
7
9
protocol P1 {
10
+ associatedtype T
8
11
var foo : Int ? { get } // expected-note {{found this candidate}}
12
+ func baz( ) -> T // expected-note {{found this candidate}}
13
+ func fiz( ) -> Int // expected-note {{found this candidate}}
9
14
}
10
15
11
16
protocol P2 : P1 {
12
17
var bar : Int ? { get }
13
18
}
14
19
15
- extension P2 where Self: A {
20
+ extension P2 where Self: A < Int > {
16
21
var bar : Int ? {
17
22
guard let foo = foo else { return 0 } // expected-error {{ambiguous use of 'foo'}}
18
- return foo
23
+ let _ = baz ( ) // expected-error {{ambiguous use of 'baz()'}}
24
+ return fiz ( ) // expected-error {{ambiguous use of 'fiz()'}}
19
25
}
20
26
}
You can’t perform that action at this time.
0 commit comments