Skip to content

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

Open
@omochi

Description

@omochi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepts invalidBug: Accepts invalidactor isolationFeature → concurrency: Actor isolationattributesFeature: Declaration and type attributesbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfconcurrencyFeature: umbrella label for concurrency language featuresswift 6.1type checkerArea → compiler: Semantic analysis

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions