Skip to content

Commit 02fc0f8

Browse files
committed
allow property binding to crate overrides if field already exists
1 parent 19acd39 commit 02fc0f8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

haxe/ui/macros/Macros.hx

+3-2
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ class Macros {
398398
var stopTimer = Context.timer("build property binding");
399399
#end
400400

401+
var hasField = builder.hasField(f.name, true);
401402
var hasGetter = builder.findFunction("get_" + f.name) != null;
402403
var hasSetter = builder.findFunction("set_" + f.name) != null;
403404

@@ -409,14 +410,14 @@ class Macros {
409410
if (hasGetter == false) {
410411
builder.addGetter(f.name, f.type, macro {
411412
return $i{variable}.$field;
412-
});
413+
}, null, !hasField, hasField);
413414
}
414415

415416
if (hasSetter == false) {
416417
builder.addSetter(f.name, f.type, macro {
417418
$i{variable}.$field = value;
418419
return value;
419-
});
420+
}, null, !hasField, hasField);
420421
}
421422

422423
if (f.expr != null) {

0 commit comments

Comments
 (0)