openfl / lime

A foundational Haxe framework for cross-platform development
https://lime.openfl.org/
MIT License
761 stars 376 forks source link

Unable to import as when importing lime.app.Event #1824

Open NeeEoo opened 3 months ago

NeeEoo commented 3 months ago

I noticed when i tried importing lime.app.Event as a different name it wouldn't let me.

Skärmavbild 2024-08-01 kl  17 54 50
joshtynjala commented 3 months ago

lime.app.Event is defined with one parameter as class Event<T>. It appears that the Haxe compiler wants you to add the parameter.

NeeEoo commented 3 months ago

Whats weird is that it works with other generic classes, but not with lime.app.Event see https://try.haxe.org/#Ae2b484D

NeeEoo commented 3 months ago
Skärmavbild 2024-08-01 kl  18 16 25

and it doesnt work when adding it, since the haxe compiler only checks for identifiers during the import statement

joshtynjala commented 3 months ago

Hmm... the error seems to come from EventMacro.

https://github.com/openfl/lime/blob/8.1.3/src/lime/_internal/macros/EventMacro.hx#L24