HaxeFoundation / HaxeFoundation/haxe

property setter is not respected when setting default value

Open
#7,284 8 comments 0 reactions 0 assignees View on GitHub
documentation
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

```haxe
class Test {
var field(default,set) = "hello";

function new() {
this.field = "hello again";
}

function set_field(value) return this.field = value;

static function main() {
trace(new Test().field);
}
}
```

generated js code:
```js
var Test = function() {
this.field = "hello";
this.set_field("hello again");
};
```

first one should be `this.set_field("hello")`, right?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.