Commit Graph

13 Commits

Author SHA1 Message Date
Pavel Yaskevich
4eb5583d36 [CSApply] For-in: Extend try injector to handle erasure and opened existential
For synthesized `<async iterator>.next()` calls expression rewriter
has to check whether witness is throwing and add `try` when necessary,
in order to do that injector needs to look through opened existentials,
erasures, and other implicitly injected AST nodes.
2022-11-03 15:06:27 -07:00
Suyash Srijan
d124b3581b [Sema] Don't ignore implicit AST nodes in diagnoseUnhandledThrowSite (#61392) 2022-10-06 09:47:50 +01:00
Karoy Lorentey
47956908b7 [Concurrency] SwiftStdlib 5.5 ⟹ SwiftStdlib 5.1 (usages)
The concurrency runtime now deploys back to macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, which corresponds to the 5.1 release of the stdlib.

Adjust macro usages accordingly.
2021-10-28 14:36:36 -07:00
Doug Gregor
eeeea49764 Remove -enable-experimental-concurrency almost everywhere. 2021-07-26 21:24:43 -07:00
Doug Gregor
1e2012d816 Disable availability checking in tests that use concurrency 2021-07-20 12:46:26 -07:00
Alexis Laferrière
3310a55682 [Test] Use the SwiftStdlib 5.5 macro in Concurrency tests 2021-05-06 13:48:49 -07:00
Pavel Yaskevich
c842773450 [Diagnostics] Re-phrase note about inferred async effect from an operation in a closure body 2021-05-04 10:09:03 -07:00
Pavel Yaskevich
886a8ab6b7 [Diagnostics] Improve diagnostics when passing async to a sync parameter
If `async` effect has been inferred from the body of the closure,
let's find out the first occurrence of `async` node and point it out
to make it clear why closure is `async`.

Resolves: rdar://70610141
2021-05-03 11:08:36 -07:00
Slava Pestov
d6db99a442 Sema: Fix effects checking of 'for await' with a concrete conformance
AsyncSequence is only polymorphic over 'throws' effects, not 'async',
because it is @rethrows and not @reasync. So the logic here was wrong,
and it would incorrectly conclude that a 'for await' with a concrete
conformance did not require the outer function to be 'async'.

Fixes rdar://problem/75436909.
2021-04-05 18:26:36 -04:00
Mike Ash
1173b737aa [Concurrency] Add availability to Concurrency APIs.
This allows programs to target older OSes while using Concurrency behind an availability check. When targeting older OSes, the symbols are weak-linked and the compiler will require the use of Concurrency features to be guarded by an availability check.

rdar://75850003
2021-04-01 10:42:08 -04:00
Slava Pestov
286927d2aa Sema: Fix effect checking bug with 'for try await'
Previously we diagnosed here if a thrown error was
unhandled, but we also have to set the flag, otherwise
we produce a warning saying that a 'do/catch' has
no throwing operations in its body.

Fixes rdar://problem/75274975.
2021-03-22 16:54:53 -04:00
Philippe Hausler
00f6af1372 Remove potential for duplicate diagnosis on rethrows 2021-02-04 13:18:27 -08:00
Philippe Hausler
9a3d613345 [Sema] Corrections for for-await-in syntax to prevent specific bad code-gen scenarios and improve diagnostics
SILGen verification crash when no other async functions are called in a function body not marked as async when a for-await-in syntax is used. This corrects the diagnostics to ensure that the type check effects sees the proper async call that the for-await-in syntax infers.

for-await-in syntax was missing a diagnistic hint for inserting a try when the protocol conformance of the sequence shows a potential of throwing. (also there was a superfluous check for the nominal type in that type check (which was removed).

for-await-in syntax and for-try-await-in syntax did not infer async or throwing to closure constraints, both were added to properly identify the asyncy-ness/throwy-ness of the iteration.
2021-02-04 09:22:05 -08:00