HaxeFoundation / haxe

Haxe - The Cross-Platform Toolkit
https://haxe.org
6.03k stars 648 forks source link

Erroneous "Unused import/using" when importing module types #11620

Open Aidan63 opened 3 months ago

Aidan63 commented 3 months ago

On nightlies if you have module Foo containing

class Foo {
    public static function foo() {}
}

class Bar {
    public static function bar() {}
}

and another module imports a specific type and uses it

import Foo.Bar;

function main() {
    Bar.bar();
}

You will receive an erroneous "Unused import/using" warning on that import. Changing the line to import the entire module import Foo has it correctly detected as used. Importing specific module level functions do not suffer from this. This works fine on 4.3.x so appears to be a regression.