I am new to Haxe and playing with the OpenFL Starling Sample code -
I noticed a @:keep metadata before the class declaration. What does it mean?
@:keep class TouchScene extends Scene {
// ...
}
Haxe allows metadata tags on classes and functions.
@:keep is a metadata tag that instructs the compiler's dead code elimination feature not to remove the class or function, even if it believes that the class or function is unused.
There are many other built-in metadata tags.
FYI, for advanced users, you can create schemas and specify your own metadata tags (and parse them using macros). For example, my lazy-props library does exactly this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With