Skip to content

Enum values in switch() #41

@fbaro

Description

@fbaro

When generating a switch on an enum, the case labels should not include the enum class name, but only the enum label.

    public enum E { A, B }
    ...
    switch (e) {
        case A: // Not case E.A
        ...
    }

It's an old issue with the original codemodel.
Unfortunately, I have no idea how to fix this with the generate() method architecture. I solved it on my local codemodel copy with an ugly instanceof in JCase.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions