File tree Expand file tree Collapse file tree 2 files changed +35
-2
lines changed Expand file tree Collapse file tree 2 files changed +35
-2
lines changed Original file line number Diff line number Diff line change @@ -335,8 +335,16 @@ class Instrumenter : InstrumenterBase {
335
335
}
336
336
case ExprKind::Load:
337
337
return digForVariable (cast<LoadExpr>(E)->getSubExpr ());
338
- case ExprKind::ForceValue:
339
- return digForVariable (cast<ForceValueExpr>(E)->getSubExpr ());
338
+ case ExprKind::ForceValue: {
339
+ std::pair<Added<Expr *>, ValueDecl *> BaseVariable =
340
+ digForVariable (cast<ForceValueExpr>(E)->getSubExpr ());
341
+ if (!*BaseVariable.first || !BaseVariable.second )
342
+ return std::make_pair (nullptr , nullptr );
343
+
344
+ Added<Expr *> Forced (
345
+ new (Context) ForceValueExpr (*BaseVariable.first , SourceLoc ()));
346
+ return std::make_pair (Forced, BaseVariable.second );
347
+ }
340
348
case ExprKind::InOut:
341
349
return digForVariable (cast<InOutExpr>(E)->getSubExpr ());
342
350
}
Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: cp %s %t/main.swift
3
+ // RUN: %target-build-swift -force-single-frontend-invocation -module-name PlaygroundSupport -emit-module-path %t/PlaygroundSupport.swiftmodule -parse-as-library -c -o %t/PlaygroundSupport.o %S/Inputs/SilentPCMacroRuntime.swift %S/Inputs/PlaygroundsRuntime.swift
4
+ // RUN: %target-build-swift -Xfrontend -playground -o %t/main -I=%t %t/PlaygroundSupport.o %t/main.swift
5
+
6
+ import PlaygroundSupport
7
+
8
+ class Layer {
9
+ var value : Double = 0
10
+ }
11
+
12
+ class Outer {
13
+ let layer : Layer ! = Layer ( )
14
+ }
15
+
16
+ class Enclosing {
17
+ var outer : Outer ! = Outer ( )
18
+
19
+ func test( ) {
20
+ // Ensure that this doesn't crash
21
+ outer. layer. value = 3.14159
22
+ }
23
+ }
24
+
25
+ Enclosing ( ) . test ( )
You can’t perform that action at this time.
0 commit comments