Skip to content

A preconcurrency conformance does not apply to parent protocols #74294

Closed
@mattmassicotte

Description

@mattmassicotte

Description

It looks like using @preconcurrency only applies to the immediate protocol, but not any others it inherits from.

Reproduction

protocol Parent {
    func a()
}

protocol Child: Parent {
    func b()
}

@MainActor
class Conformance: @preconcurrency Child {
    func a() {
    }

    func b() {
    }
}

Expected behavior

I would expect no errors.

Environment

Apple Swift version 6.0-dev (LLVM bf8bbb910874156, Swift a0bb875)
Target: arm64-apple-macosx14.0

Additional information

No response

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