blob: 2b2908fc23e6ead6fa0a480bfc236964e653e2d4 [file] [log] [blame]
library;
import self as self;
import "dart:core" as core;
static method test(dynamic o) dynamic {
#L1:
{
final synthesized dynamic #0#0 = o;
{
hoisted core::int a;
if(#0#0 is core::int && (let final dynamic #t1 = a = #0#0{core::int} in true)) {
{
return 1;
}
}
}
}
#L2:
{
final synthesized dynamic #1#0 = o;
{
hoisted core::String a;
if(#1#0 is core::String && (let final dynamic #t2 = a = #1#0{core::String} in true)) {
{
return 2;
}
}
}
}
return 0;
}
static method main() dynamic {
self::expect(1, self::test(0));
self::expect(2, self::test("foo"));
self::expect(0, self::test(true));
}
static method expect(dynamic expected, dynamic actual) dynamic {
if(!(expected =={core::Object::==}{(core::Object) core::bool} actual)) {
throw "Expected ${expected}, actual ${actual}";
}
}