Skip to content

nonisolated should not be allowed with actor #85174

@BMLJL

Description

@BMLJL

Description

nonisolated keyword seems to serve no purpose next to actor. By nature, they are contradictory and there is no clear indication of how it will behave.

This was behaving correctly (with a compilation error) in 6.03 example, but started compiling from 6.1.

Reproduction

nonisolated actor Counter {

    var counter = 0

    func increment() {
        counter += 1
    }
}

Expected behavior

nonisolated actor MyActor {} Should produce a compilation error.

Environment

swiftc 6.1+

Additional information

No response

Metadata

Metadata

Assignees

Labels

accepts invalidBug: Accepts invalidactorFeature → concurrency: `actor` declarationsactor isolationFeature → concurrency: Actor isolationcompilerThe Swift compiler itselfconcurrencyFeature: umbrella label for concurrency language featurestype checkerArea → compiler: Semantic analysis

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions