File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
validation-test/compiler_crashers_2_fixed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -1943,7 +1943,7 @@ Expr *AutoClosureExpr::getUnwrappedCurryThunkExpr() const {
19431943 body = body->getSemanticsProvidingExpr ();
19441944
19451945 if (auto *openExistential = dyn_cast<OpenExistentialExpr>(body)) {
1946- body = openExistential->getSubExpr ();
1946+ body = openExistential->getSubExpr ()-> getSemanticsProvidingExpr () ;
19471947 }
19481948
19491949 if (auto *outerCall = dyn_cast<ApplyExpr>(body)) {
@@ -1963,7 +1963,7 @@ Expr *AutoClosureExpr::getUnwrappedCurryThunkExpr() const {
19631963 innerBody = innerBody->getSemanticsProvidingExpr ();
19641964
19651965 if (auto *openExistential = dyn_cast<OpenExistentialExpr>(innerBody)) {
1966- innerBody = openExistential->getSubExpr ();
1966+ innerBody = openExistential->getSubExpr ()-> getSemanticsProvidingExpr () ;
19671967 if (auto *ICE = dyn_cast<ImplicitConversionExpr>(innerBody))
19681968 innerBody = ICE->getSyntacticSubExpr ();
19691969 }
Original file line number Diff line number Diff line change 1+ // RUN: %empty-directory(%t)
2+ // RUN: %target-swift-frontend -index-store-path %t/idx -o %t/file.o -typecheck -primary-file %s -verify
3+
4+ protocol MyProto {
5+ func compile( ) throws
6+ }
7+
8+ func compile( x: MyProto ) throws {
9+ try x. compile
10+ // expected-error@-1 {{expression resolves to an unused function}}
11+ // expected-warning@-2 {{no calls to throwing functions occur within 'try' expression}}
12+ }
You can’t perform that action at this time.
0 commit comments