Skip to content

UnusedImport false positive when enum abstract var is using #523

@T1mL3arn

Description

@T1mL3arn

Example

// file BaseMenu.hx
package menu;

enum abstract MenuCommand(String) to String {
	var EXIT_GAME;
}

// file Main.hx
import menu.BaseMenu.MenuCommand;

var abc = '123';
switch (abc) {
  case EXIT_GAME:  trace('exit');
  default: 0;
}

gives UnusedImport - Unused import "menu.BaseMenu.MenuCommand" detected.

If I change case EXIT_GAME to case MenuCommand.EXIT_GAME there is no detection, so I guess checkstyle does not know EXIT_GAME is from MenuCommand (though in vscode really unused imports are grayed-out).

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