blob: 0a41e734637c55165362d1f4096785bc381748b1 [file] [log] [blame]
library;
import self as self;
import "dart:core" as core;
static method test(dynamic x) dynamic {
{
hoisted core::String y;
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::String && (let final core::String #t1 = y = #0#6{core::String} in true))) {
return y;
}
else {
return null;
}
}
}
static method main() dynamic {
self::expectEquals(self::test(core::_GrowableList::_literal3<core::String>("one", "two", "three")), null);
self::expectEquals(self::test(core::_GrowableList::_literal1<core::String>("one")), "one");
self::expectEquals(self::test(core::_GrowableList::_literal3<core::int>(1, 2, 3)), null);
self::expectEquals(self::test(core::_GrowableList::_literal1<core::int>(1)), null);
self::expectEquals(self::test(core::_GrowableList::_literal2<core::bool>(true, false)), null);
self::expectEquals(self::test(core::_GrowableList::_literal1<core::bool>(true)), null);
self::expectEquals(self::test(core::_GrowableList::•<dynamic>(0)), null);
}
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
}