Skip to content

@concurrent main function runs on main actor #83790

@AnthonyLatsis

Description

@AnthonyLatsis

Description

No response

Reproduction

@main struct Foo {
  @concurrent static func main() async throws {
    print(Thread.isMainThread) // true
  }
}

Expected behavior

Runs on the concurrent executor

Environment

swift-driver version: 1.127.14.1 Apple Swift version 6.2 (swiftlang-6.2.0.19.8 clang-1700.3.19.1)

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    @concurrentFeature → attributes: The @concurrent attribute@mainFeature → attributes: the @main attributeSILGenArea → compiler: The SIL generation stageactor isolationFeature → concurrency: Actor isolationbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfconcurrencyFeature: umbrella label for concurrency language featuresswift 6.2unexpected behaviorBug: Unexpected behavior or incorrect output

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions