I get a compile error when having something like this in a Model (code just written out of the top of my head, sorry):
class MyModel implements Model {
@:loaded var somethingAmazing:Int = {
if (incredibleProperty == 0) calculatePlanToConquerWorld($last);
else if (incredibleProperty == 1) haveBreakfastBeforeConqueringTheWorld($last);
else conquerWorld();
};
@:editable private var incredibleProperty:Int = -1;
function calculatePlanToConquerWorld(whoKnows:Int) return Future.sync(1);
function haveBreakfastBeforeConqueringTheWorld(whoKnows:Int) return Future.sync(2);
}
It seems both $lasts are replaced by the same variable that is generated in the same scope as whichever is processed first (assumption based just in the error message and that having a top level $last or single inner scope $last works).
I get a compile error when having something like this in a
Model
(code just written out of the top of my head, sorry):It seems both
$last
s are replaced by the same variable that is generated in the same scope as whichever is processed first (assumption based just in the error message and that having a top level$last
or single inner scope$last
works).