Skip to content

Code does not build when associatedtype inherits from Error #50

@nermolenko-fhl

Description

@nermolenko-fhl

Hey! Faced a strange problem. The following code fails to compile:

protocol TestProtocol: AnyObject {
    associatedtype Err: Error
}

private extension TestProtocol {
    @AssociatedObject(.retain(.nonatomic))
    var test: Bool = false
}

The compilation error occurs when associatedtype Err: Error is present. If I remove : Error (so it becomes just associatedtype Err), the code builds successfully.

Sadly, but the error message is not helpful:

Command EmitSwiftModule failed with a nonzero exit code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions