While we might add HaxeFoundation/haxe-evolution#96 in 5.0 (?), current property syntax could be enhanced with a new modifier which would be equivalent to public var propertyWithField:T { get; set; }:
public var propertyWithField(default get, default set):T;
This would be equivalent to:
@:isVar
public var propertyWithField(get, set):T;
function get_propertyWithField():T return propertyWithField;
function set_propertyWithField(val:T):T return propertyWithField = val;
Which allows child classes to override getter/setter.
Also while we're at it, maybe init like in C# would be a nice addition now that we have final fields with similar behavior 🤔
While we might add HaxeFoundation/haxe-evolution#96 in 5.0 (?), current property syntax could be enhanced with a new modifier which would be equivalent to
public var propertyWithField:T { get; set; }:This would be equivalent to:
Which allows child classes to override getter/setter.
Also while we're at it, maybe
initlike in C# would be a nice addition now that we havefinalfields with similar behavior 🤔