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