Skip to content

Swift 5.9 compiler fails on some Actor (regression) #67891

Closed
@dehesa

Description

@dehesa

Description
Using some Actor in a @globalActor definition makes the compiler fail. The provided sample code compiles fine in previous Swift versions (Xcode 14.3.1, 15.0.0 Beta 1 to 4) but it does not compile in the latest compilers (Xcode 15 Beta 5 and 6).

Steps to reproduce

  • Add the following file in your project

    @globalActor enum Serializer {
      static let shared: some Actor = AccessManager()
    }
    
    private actor AccessManager {
      // Custom functionality here
    }
  • Even without using Serializer anywhere, the compiler will fail with a nonzero exit code.

I have also left a project attached below as demonstration.

Expected behavior

Previous compiler were able to compile the file just fine. We were relying on that behavior at Raycast.

Environment

  • Swift compiler: swift-driver version: 1.87.1 Apple Swift version 5.9 (swiftlang-5.9.0.128.2 clang-1500.0.40.1)
  • Xcode version: Xcode 15.0.0 Beta 6 (also happens in Beta 5)
  • Deployment target: arm64-apple-macosx14.0

Sample Project
SomeActor.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.concurrencyFeature: umbrella label for concurrency language features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions