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 {
1943
1943
body = body->getSemanticsProvidingExpr ();
1944
1944
1945
1945
if (auto *openExistential = dyn_cast<OpenExistentialExpr>(body)) {
1946
- body = openExistential->getSubExpr ();
1946
+ body = openExistential->getSubExpr ()-> getSemanticsProvidingExpr () ;
1947
1947
}
1948
1948
1949
1949
if (auto *outerCall = dyn_cast<ApplyExpr>(body)) {
@@ -1963,7 +1963,7 @@ Expr *AutoClosureExpr::getUnwrappedCurryThunkExpr() const {
1963
1963
innerBody = innerBody->getSemanticsProvidingExpr ();
1964
1964
1965
1965
if (auto *openExistential = dyn_cast<OpenExistentialExpr>(innerBody)) {
1966
- innerBody = openExistential->getSubExpr ();
1966
+ innerBody = openExistential->getSubExpr ()-> getSemanticsProvidingExpr () ;
1967
1967
if (auto *ICE = dyn_cast<ImplicitConversionExpr>(innerBody))
1968
1968
innerBody = ICE->getSyntacticSubExpr ();
1969
1969
}
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