Skip to content

Allow custom encoding functions for RawRepresentable enums #27

@tengyifei

Description

@tengyifei

Suppose the following:

enum Gender: Int {
    case female
    case male
}

extension Gender: CerealType {
    // custom encode and decode
}

And encode was called on a variable of type Gender, then the RawRepresentable override version will be called, ignoring the custom serializers.

I know it's not a huge issue, but it could be fixed by providing an encodeCereal function for example, to explicitly invoke the custom serializers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions