Skip to content

Commit 0054e22

Browse files
committed
Resolves #86.
1 parent 8422090 commit 0054e22

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/coconut/data/macros/ModelBuilder.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ class ModelBuilder {
214214

215215
if (afterInit.length > 0)
216216
constr.addStatement(macro tink.state.Observable.untracked(function () {
217-
$b{afterInit};
217+
(function () $b{afterInit})();
218218
return null;
219219
}));
220220
}

tests/issues/Issue78.hx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ package issues;
44
class Issue78 {
55
public function new() {}
66

7-
@:include
87
public function test() {
98
var m = new Issue78Model(42);
109
asserts.assert(m.foo == 43);
@@ -19,6 +18,6 @@ class Issue78Model implements Model {
1918
@:computed var bar:Int = foo + 1;
2019

2120
public function new(foo:Int) {
22-
this = { foo: foo + 1 }
23-
}
21+
this = { foo: foo + 1 }
22+
}
2423
}

0 commit comments

Comments
 (0)