Skip to content

redundantSendable creates warning for recursive enums #2563

Description

@nicklockwood

This might be a bug in the Swift compiler, but it's an issue regardless: The redundantSendable rule removes Sendable from the ValueType enum here, but without it I get a warning.

It only appears to be a problem for enums that contain a case that reference themselves.

enum ValueType: Hashable {
    case any
    indirect case list(ValueType)
}

extension ValueType {
    static let memberTypes: [String: ValueType] = [:] // <-- warns that ValueType is not Sendable
}
Image

Metadata

Metadata

Assignees

Labels

bugfixed in developbug/feature resolved in the develop branch

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions