We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8f79bb8 commit 731c516Copy full SHA for 731c516
test/stmt/statements.swift
@@ -378,10 +378,20 @@ func throwingFuncInDefer1() throws {
378
}
379
380
func throwingFuncInDefer2() throws {
381
+ defer { throwingFunctionCalledInDefer() } // expected-error {{errors cannot be thrown out of a defer body}}
382
+ print("Bar")
383
+}
384
+
385
+func throwingFuncInDefer3() {
386
defer { try throwingFunctionCalledInDefer() } // expected-error {{errors cannot be thrown out of a defer body}}
387
print("Bar")
388
389
390
+func throwingFuncInDefer4() {
391
392
393
394
395
func throwingFunctionCalledInDefer() throws {
396
throw DeferThrowError.someError
397
0 commit comments