blob: 81952ce5057e924dd380d73c6427bcfd47e64556 [file] [log] [blame]
library;
import self as self;
import "dart:core" as core;
static method test(dynamic x) dynamic {
{
hoisted core::int a;
final synthesized dynamic #0#0 = x;
function ##0#6#initializer() → dynamic
return (#0#0 as{Unchecked} core::List<dynamic>).{core::List::[]}(0){(core::int) → dynamic};
late final synthesized dynamic #0#6 = ##0#6#initializer(){() → dynamic};
if(#0#0 is core::List<dynamic> && #0#0{core::List<dynamic>}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1 && (#0#6 is core::int && (let final core::int #t1 = a = #0#6{core::int} in true)) && a.{core::num::>}(0){(core::num) → core::bool}) {
return a;
}
}
return 0;
}
static method main() dynamic {
self::expectEquals(1, self::test(core::_GrowableList::_literal1<core::int>(1)));
self::expectEquals(0, self::test(core::_GrowableList::_literal1<core::int>(0)));
self::expectEquals(0, self::test(core::_GrowableList::_literal1<core::int>(1.{core::int::unary-}(){() core::int})));
}
static method expectEquals(dynamic x, dynamic y) dynamic {
if(!(x =={core::Object::==}{(core::Object) core::bool} y)) {
throw "Expected ${x} to be equal to ${y}.";
}
}
constants {
#C1 = 1
}
Extra constant evaluation status:
Evaluated: InstanceInvocation @ org-dartlang-testcase:///simple_guard_clause_runtime_test.dart:15:25 -> IntConstant(-1)
Extra constant evaluation: evaluated: 40, effectively constant: 1