blob: d84acbf32783649fda10d54f14aaf2a455c33b72 [file] [log] [blame]
library;
import self as self;
import "dart:core" as core;
static method test(dynamic x) dynamic {
#L1:
{
final synthesized dynamic #0#0 = x;
{
lowered hoisted core::int x#case#0;
lowered hoisted core::String x#case#1;
if(#0#0 is core::int && (let final dynamic #t1 = x#case#0 = #0#0{core::int} in true) && x#case#0.{core::num::>}(0){(core::num) → core::bool} || #0#0 is core::String && (let final dynamic #t2 = x#case#1 = #0#0{core::String} in true) && x#case#1.{core::String::startsWith}("f"){(core::Pattern, [core::int]) → core::bool}) {
{
return 1;
}
}
}
{
{
{
return 0;
}
}
}
}
}
static method main() dynamic {
self::expectEquals(self::test(0), 0);
self::expectEquals(self::test(1), 1);
self::expectEquals(self::test(2), 1);
self::expectEquals(self::test("foo"), 1);
self::expectEquals(self::test("bar"), 0);
}
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}'.";
}
}