-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calling noasync
function inside a defer
#73614
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
concurrency
Feature: umbrella label for concurrency language features
Comments
0xTim
added
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
triage needed
This issue needs more specific labels
labels
May 14, 2024
ktoso
changed the title
Calling
Calling May 15, 2024
noasync
function inside a `defernoasync
function inside a defer
ktoso
added
concurrency
Feature: umbrella label for concurrency language features
and removed
triage needed
This issue needs more specific labels
labels
May 15, 2024
jamieQ
added a commit
to jamieQ/swift
that referenced
this issue
May 23, 2024
updates noasync diagnostics in TypeCheckAvailability.cpp to diagnose defer bodies as if they had the same `isAsyncContext()` value as their nearest non-defer parent scope. resolves: apple#73614
jamieQ
added a commit
to jamieQ/swift
that referenced
this issue
May 24, 2024
updates noasync diagnostics in TypeCheckAvailability.cpp to diagnose defer bodies as if they had the same `isAsyncContext()` value as their nearest non-defer parent scope. resolves: apple#73614
jamieQ
added a commit
to jamieQ/swift
that referenced
this issue
May 24, 2024
updates noasync diagnostics in TypeCheckAvailability.cpp to diagnose defer bodies as if they had the same `isAsyncContext()` value as their nearest non-defer parent scope. resolves: apple#73614
jamieQ
added a commit
to jamieQ/swift
that referenced
this issue
May 24, 2024
updates noasync diagnostics in TypeCheckAvailability.cpp to diagnose defer bodies as if they had the same `isAsyncContext()` value as their nearest non-defer parent scope. resolves: apple#73614
jamieQ
added a commit
to jamieQ/swift
that referenced
this issue
May 25, 2024
updates noasync diagnostics in TypeCheckAvailability.cpp to diagnose defer bodies as if they had the same `isAsyncContext()` value as their nearest non-defer parent scope. resolves: apple#73614
jamieQ
added a commit
to jamieQ/swift
that referenced
this issue
May 27, 2024
updates noasync diagnostics in TypeCheckAvailability.cpp to diagnose defer bodies as if they had the same `isAsyncContext()` value as their nearest non-defer parent scope. resolves: apple#73614 (cherry picked from commit e68c36b)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
concurrency
Feature: umbrella label for concurrency language features
Description
When annotating a function as
noasync
, the compiler should produce a warning when calling that function from an async context - such as an async function. When calling anoasync
function from adefer
block inside an async function, the warning is not produced which can lead to unexpected behaviour.Reproduction
Expected behavior
The compiler should produce 2 warnings, for each call of
somethingSync()
insideasyncFunc
. It currently only produces a warning for the call outside the defer blockEnvironment
swift-driver version: 1.90.11.1 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
Target: arm64-apple-macosx14.0
Additional information
No response
The text was updated successfully, but these errors were encountered: