1
+ protocol It {
2
+ associatedtype Assoc
3
+ }
4
+
1
5
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=PARAM_0 | %FileCheck %s -check-prefix=TOP_LEVEL_0
2
6
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RETURN_0 | %FileCheck %s -check-prefix=TOP_LEVEL_0
3
7
@@ -82,4 +86,35 @@ struct G5 {
82
86
subscript< T> ( x: T ) -> T . #^GEN_RETURN_5 ^# { return 0 }
83
87
}
84
88
// GEN_PARAM_5: Keyword/None: Type[#T.Type#];
85
- // GEN_PARAM_5-NOT: Keyword/CurrNominal: self[#T#];
89
+ // GEN_PARAM_5-NOT: Keyword/CurrNominal: self[#T#];
90
+
91
+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GEN_PARAM_6 | %FileCheck %s -check-prefix=GEN_PARAM_6
92
+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GEN_RETURN_6 | %FileCheck %s -check-prefix=GEN_PARAM_6
93
+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GEN_EXT_PARAM_6 | %FileCheck %s -check-prefix=GEN_PARAM_6
94
+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GEN_EXT_RETURN_6 | %FileCheck %s -check-prefix=GEN_PARAM_6
95
+ struct G6 < T: It > {
96
+ subscript( a x: T . #^GEN_PARAM_6 ^#) -> Int { return 0 }
97
+ subscript( a x: Int ) -> T . #^GEN_RETURN_6 ^# { return 0 }
98
+ }
99
+ extension G6 {
100
+ subscript( b x: T . #^GEN_EXT_PARAM_6 ^#) -> Int { return 0 }
101
+ subscript( b x: Int ) -> T . #^GEN_EXT_RETURN_6 ^# { return 0 }
102
+ }
103
+ // GEN_PARAM_6-DAG: Decl[AssociatedType]/Super: Assoc;
104
+ // GEN_PARAM_6-DAG: Keyword/None: Type[#T.Type#];
105
+
106
+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GENPROTO_PARAM_1 | %FileCheck %s -check-prefix=GENPROTO_1
107
+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GENPROTO_RETURN_1 | %FileCheck %s -check-prefix=GENPROTO_1
108
+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GENPROTO_EXT_PARAM_1 | %FileCheck %s -check-prefix=GENPROTO_1
109
+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GENPROTO_EXT_RETURN_1 | %FileCheck %s -check-prefix=GENPROTO_1
110
+ protocol GP1 {
111
+ associatedtype I : It
112
+ subscript( a x: I . #^GENPROTO_PARAM_1 ^#) -> Int
113
+ subscript( ax: Int ) -> I . #^GENPROTO_RETURN_1 ^#
114
+ }
115
+ extension GP1 {
116
+ subscript ( b x: I. #^GENPROTO_EXT_PARAM_1^#) - > Int { return 1 }
117
+ subscript ( b x: Int) - > I. #^GENPROTO_EXT_RETURN_1^# { return 1 }
118
+ }
119
+ // GENPROTO_1-DAG: Decl[AssociatedType]/Super: Assoc;
120
+ // GENPROTO_1-DAG: Keyword/None: Type[#Self.I.Type#];
0 commit comments