blob: f55013069158938dea97d453aade4c08f6a5dfbf [file] [log] [blame]
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
class C extends core::Object {
static field core::String? _#s = null;
static field core::bool _#s#isSet = false;
synthetic constructor •() self::C
: super core::Object::•()
;
static get s() core::String? {
if(!self::C::_#s#isSet) {
self::C::_#s = self::init("lateValue");
self::C::_#s#isSet = true;
}
return self::C::_#s;
}
static set s(core::String? #t1) → void {
self::C::_#s#isSet = true;
self::C::_#s = #t1;
}
}
static field core::bool _called = false;
static method init(core::String val) core::String {
if(!self::_called) {
self::_called = true;
throw core::Exception::•();
}
return val;
}
static method main() dynamic {
self::throws(() void {
self::C::s;
});
self::expect("lateValue", self::C::s);
}
static method expect(dynamic expected, dynamic actual) dynamic {
if(!expected.{core::Object::==}(actual))
throw "Expected ${expected}, actual ${actual}";
}
static method throws(() void f) dynamic {
try {
f.call();
}
on core::Object catch(final core::Object _) {
return;
}
throw "Expected exception";
}