Skip to content

ECJ reports about non-existing modifiers on a local class in a switch expression #4584

@jarthana

Description

@jarthana

This is similar to #4241 but here it is about ECJ seeing modifiers that don't exist:

public interface X {
    int i = switch (0) {
        case 2 -> {
            class ParentLocal { // This is rejected
            }
            yield 1;
        }
        default -> {
            yield 0;
        }
    };
}

Here, in the highlighted line, ECJ reports "Illegal modifier for the local class ParentLocal; only abstract or final is permitted".

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions