blob: 850613c2d1d3aaf0d5e33e5b3d50efebc6dcc629 [file] [log] [blame]
library;
import self as self;
import "dart:core" as core;
static method lateLocalInit() core::int?
return 123;
static method main() dynamic {
core::int? lateLocal;
core::bool #lateLocal#isSet = false;
function #lateLocal#get() → core::int? {
if(!#lateLocal#isSet) {
#lateLocal#isSet = true;
lateLocal = self::lateLocalInit();
}
return lateLocal;
}
function #lateLocal#set(core::int? #t1) → dynamic {
#lateLocal#isSet = true;
return lateLocal = #t1;
}
self::expect(123, #lateLocal#get.call());
self::expect(124, #lateLocal#set.call(124));
self::expect(124, #lateLocal#get.call());
}
static method expect(dynamic expected, dynamic actual) dynamic {
if(!expected.{core::Object::==}(actual))
throw "Expected ${expected}, actual ${actual}";
}