Skip to content

Commit 46415cc

Browse files
committed
[TypeChecker] NFC: Update improved without_actually_escaping test-case
1 parent 150203c commit 46415cc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/Constraints/without_actually_escaping.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,10 @@ func rethrowThroughWAE(_ zz: (Int, Int, Int) throws -> Int, _ value: Int) throws
6060
}
6161
}
6262

63-
let _: ((Int) -> Int, (@escaping (Int) -> Int) -> ()) -> ()
64-
= withoutActuallyEscaping(_:do:) // expected-error{{}}
63+
// There should be two errors - here one for async -> sync, and another throws -> non-throws
64+
let _: ((Int) -> Int, (@escaping (Int) -> Int) -> ()) -> () = withoutActuallyEscaping(_:do:)
65+
// expected-error@-1 {{invalid conversion from throwing function of type '((Int) -> Int, (@escaping (Int) -> Int) async throws -> ()) async throws -> ()' to non-throwing function type '((Int) -> Int, (@escaping (Int) -> Int) -> ()) -> ()'}}
66+
// expected-error@-2 {{invalid conversion from 'async' function of type '((Int) -> Int, (@escaping (Int) -> Int) async throws -> ()) async throws -> ()' to synchronous function type '((Int) -> Int, (@escaping (Int) -> Int) -> ()) -> ()'}}
6567

6668

6769
// Failing to propagate @noescape into non-single-expression

0 commit comments

Comments
 (0)