File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -205,6 +205,7 @@ ConstantValueInfoRequest::evaluate(Evaluator &Evaluator,
205
205
Properties.push_back (
206
206
{Property, extractPropertyInitializationValue (Property)});
207
207
}
208
+
208
209
for (auto Member : Decl->getMembers ()) {
209
210
auto *VD = dyn_cast<VarDecl>(Member);
210
211
// Ignore plain stored properties collected above,
@@ -214,6 +215,14 @@ ConstantValueInfoRequest::evaluate(Evaluator &Evaluator,
214
215
Properties.push_back ({VD, extractPropertyInitializationValue (VD)});
215
216
}
216
217
218
+ for (auto Extension: Decl->getExtensions ()) {
219
+ for (auto Member : Extension->getMembers ()) {
220
+ if (auto *VD = dyn_cast<VarDecl>(Member)) {
221
+ Properties.push_back ({VD, extractPropertyInitializationValue (VD)});
222
+ }
223
+ }
224
+ }
225
+
217
226
return ConstValueTypeInfo{Decl, Properties};
218
227
}
219
228
Original file line number Diff line number Diff line change 154
154
// CHECK-NEXT: "isComputed": "true",
155
155
// CHECK-NEXT: "valueKind": "RawLiteral",
156
156
// CHECK-NEXT: "value": "3"
157
+ // CHECK-NEXT: },
158
+ // CHECK-NEXT: {
159
+ // CHECK-NEXT: "label": "e1",
160
+ // CHECK-NEXT: "type": "fields.Foo.Boo",
161
+ // CHECK-NEXT: "isStatic": "false",
162
+ // CHECK-NEXT: "isComputed": "true",
163
+ // CHECK-NEXT: "valueKind": "Runtime"
157
164
// CHECK-NEXT: }
158
165
// CHECK-NEXT: ]
159
166
// CHECK-NEXT: }
@@ -178,6 +185,12 @@ public struct Foo {
178
185
let p13 : Int = adder ( 2 , 3 )
179
186
}
180
187
188
+ extension Foo {
189
+ struct Boo { }
190
+
191
+ var e1 : Boo { Boo ( ) }
192
+ }
193
+
181
194
func adder( _ x: Int , _ y: Int ) -> Int {
182
195
x + y
183
196
}
You can’t perform that action at this time.
0 commit comments