File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
validation-test/compiler_crashers_2_fixed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -134,6 +134,9 @@ class AbstractFunction {
134
134
fn = conversion->getSubExpr ()->getValueProvidingExpr ();
135
135
} else if (auto conversion = dyn_cast<BindOptionalExpr>(fn)) {
136
136
fn = conversion->getSubExpr ()->getValueProvidingExpr ();
137
+ // Look through optional injections
138
+ } else if (auto injection = dyn_cast<InjectIntoOptionalExpr>(fn)) {
139
+ fn = injection->getSubExpr ()->getValueProvidingExpr ();
137
140
// Look through function conversions.
138
141
} else if (auto conversion = dyn_cast<FunctionConversionExpr>(fn)) {
139
142
fn = conversion->getSubExpr ()->getValueProvidingExpr ();
Original file line number Diff line number Diff line change
1
+ // RUN: %target-typecheck-verify-swift
2
+
3
+ // Used to crash with: apply expression is not marked as throwing or
4
+ // non-throwing
5
+ struct SR5427 : Error { }
6
+ func sr5427( op: ( ( ) throws -> Void ) ? ) rethrows { try op ? ( ) }
7
+ try ? sr5427 ( op: { throw SR5427 ( ) } )
You can’t perform that action at this time.
0 commit comments