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 @@ -2012,7 +2012,7 @@ Expr *AutoClosureExpr::getUnwrappedCurryThunkExpr() const {
2012
2012
body = body->getSemanticsProvidingExpr ();
2013
2013
2014
2014
if (auto *openExistential = dyn_cast<OpenExistentialExpr>(body)) {
2015
- body = openExistential->getSubExpr ();
2015
+ body = openExistential->getSubExpr ()-> getSemanticsProvidingExpr () ;
2016
2016
}
2017
2017
2018
2018
if (auto *outerCall = dyn_cast<ApplyExpr>(body)) {
@@ -2032,7 +2032,7 @@ Expr *AutoClosureExpr::getUnwrappedCurryThunkExpr() const {
2032
2032
innerBody = innerBody->getSemanticsProvidingExpr ();
2033
2033
2034
2034
if (auto *openExistential = dyn_cast<OpenExistentialExpr>(innerBody)) {
2035
- innerBody = openExistential->getSubExpr ();
2035
+ innerBody = openExistential->getSubExpr ()-> getSemanticsProvidingExpr () ;
2036
2036
if (auto *ICE = dyn_cast<ImplicitConversionExpr>(innerBody))
2037
2037
innerBody = ICE->getSyntacticSubExpr ();
2038
2038
}
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