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,
205205 Properties.push_back (
206206 {Property, extractPropertyInitializationValue (Property)});
207207 }
208+
208209 for (auto Member : Decl->getMembers ()) {
209210 auto *VD = dyn_cast<VarDecl>(Member);
210211 // Ignore plain stored properties collected above,
@@ -214,6 +215,14 @@ ConstantValueInfoRequest::evaluate(Evaluator &Evaluator,
214215 Properties.push_back ({VD, extractPropertyInitializationValue (VD)});
215216 }
216217
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+
217226 return ConstValueTypeInfo{Decl, Properties};
218227}
219228
Original file line number Diff line number Diff line change 154154// CHECK-NEXT: "isComputed": "true",
155155// CHECK-NEXT: "valueKind": "RawLiteral",
156156// 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"
157164// CHECK-NEXT: }
158165// CHECK-NEXT: ]
159166// CHECK-NEXT: }
@@ -178,6 +185,12 @@ public struct Foo {
178185 let p13 : Int = adder ( 2 , 3 )
179186}
180187
188+ extension Foo {
189+ struct Boo { }
190+
191+ var e1 : Boo { Boo ( ) }
192+ }
193+
181194func adder( _ x: Int , _ y: Int ) -> Int {
182195 x + y
183196}
You can’t perform that action at this time.
0 commit comments