File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ // RUN: %target-typecheck-verify-swift -enable-experimental-associated-type-inference
2+ // RUN: %target-typecheck-verify-swift -disable-experimental-associated-type-inference
3+
4+ protocol Task1 : AnyObject {
5+ }
6+
7+ protocol Task2 : AnyObject {
8+ }
9+
10+ class TaskImpl : Task2 {
11+ }
12+
13+ protocol TaskResult {
14+ associatedtype Task
15+
16+ var tasks : [ Task ] { get }
17+
18+ func removeMatchedTask( _ task: Task )
19+ func match( _ task: Task ) -> Bool
20+ }
21+
22+ extension TaskResult where Task == Task1 {
23+ func match( _ task: Task ) -> Bool { false }
24+ }
25+
26+ extension TaskResult where Task: Task2 {
27+ func match( _ task: Task ) -> Bool { false }
28+ }
29+
30+ final class Results : TaskResult {
31+ var tasks : [ TaskImpl ] = [ ]
32+
33+ func removeMatchedTask( _ task: TaskImpl ) { }
34+ }
You can’t perform that action at this time.
0 commit comments