Skip to content

Consider enum cases as objects? #598

@OlegYch

Description

@OlegYch

currently

enum A { case AA }

is not considered equivalent to

sealed trait A; object A { case object AA extends A }

but probably should be

i would suggest changing isObject macro to

Expr(TypeRepr.of[T].typeSymbol.flags.is(Flags.Module) || Expr(TypeRepr.of[T].typeSymbol.flags.is(Flags.Enum | Flags.Abstract)))

or adding a separate field to CaseClass like isEnumValue

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