Skip to content

removeUnusedImport check fails when there are pattern matching switch expressions with inner classes #2492

Open
@Earthcomputer

Description

@Earthcomputer

I have the following switch expression

result = switch (literal) {
	case Literal.Integer(int value, int ignored) -> value;
	case Literal.Long(long value, int ignored) -> value;
	case Literal.Float(float value) -> value;
	case Literal.Double(double value) -> value;
	case Literal.Character(char value) -> value;
	case Literal.String(String value) -> value;
};

and it causes the removeUnusedImport rule to fail with the following message:

  src/main/java/daomephsta/unpick/impl/constantmappers/datadriven/ExpressionEvaluator.java:L142 removeUnusedImports(removeUnusedImports) error: '.class' expected

full code

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