Skip to content
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

It’s possible to write arbitrary text after specifying the @MainActor for a closure. #76540

Open
omochi opened this issue Sep 18, 2024 · 1 comment
Labels
accepts invalid Bug: Accepts invalid actor isolation Feature → concurrency: Actor isolation attributes Feature: Declaration and type attributes bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler itself concurrency Feature: umbrella label for concurrency language features swift 6.1 type checker Area → compiler: Semantic analysis

Comments

@omochi
Copy link
Contributor

omochi commented Sep 18, 2024

Description

The following strange code compiles incorrectly:

Reproduction

Task { @MainActor(今日は日差しが強い) in
}

Expected behavior

It should result in some kind of error.

Environment

$ swift --version
swift-driver version: 1.115 Apple Swift version 6.0 (swiftlang-6.0.0.9.10 clang-1600.0.26.2)
Target: arm64-apple-macosx15.0

Additional information

No response

@omochi omochi added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels labels Sep 18, 2024
@AnthonyLatsis AnthonyLatsis added parser Area → compiler: The legacy C++ parser compiler The Swift compiler itself accepts invalid Bug: Accepts invalid attributes Feature: Declaration and type attributes swift 6.1 concurrency Feature: umbrella label for concurrency language features type checker Area → compiler: Semantic analysis actor isolation Feature → concurrency: Actor isolation and removed parser Area → compiler: The legacy C++ parser triage needed This issue needs more specific labels labels Sep 18, 2024
@AnthonyLatsis
Copy link
Collaborator

A different test case:

let _: @MainActor(abcdef) () -> Void = {}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepts invalid Bug: Accepts invalid actor isolation Feature → concurrency: Actor isolation attributes Feature: Declaration and type attributes bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler itself concurrency Feature: umbrella label for concurrency language features swift 6.1 type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

2 participants