@:structInit with getter+setter won't compile
rcstuber opened this issue · comments
rcstuber commented
TryHaxe: https://try.haxe.org/#adC36E0e
@:structInit
class Foo {
public var bar(get, set):String;
function get_bar()
return "bar";
function set_bar(v)
return v;
}
class Test {
static function main() {
var foo : Foo = {}; // error: "Object requires field bar"
}
}
This won't compile, as it complains that the field bar
is required. Since it's not a real field, this shouldn't happen though.
Thanks in advance!
rcstuber commented
Thanks a lot @Apprentice-Alchemist for the fast fix and @Simn for merging!