In Haxe, static getters and setters are a thing and are applied within the class. But for some reason polymod just doesn't do that. With Try Haxe it works as you'd expect, but not with polymod.
For example, if you try this in polymod:
import funkin.modding.module.Module;
class StaticTest {
static var test(get, set):Int;
static function get_test():Int {
return 2;
}
static function set_test(value:Int):Int {
trace('hello');
return 2;
}
static function set(val) {
trace(test);
test = val;
trace(test);
}
}
class Test extends Module {
public function new() {
super('Test');
}
public function onCreate(event) {
super.onCreate(event);
StaticTest.set(5);
}
}
You'd get