blob: 6853a0d642d3cffae5fa3f3319dfaf2f39e1c5e6 [file] [log] [blame]
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
class A extends core::Object {
field core::int foo;
constructor •(core::int foo) self::A
: self::A::foo = foo, super core::Object::•()
;
get bar() core::int
return throw "Bye";
}
static method main() void {
self::A obj = new self::A::•(42);
core::int f = 1.{core::int::unary-}(){() core::int};
core::int b = 1.{core::int::unary-}(){() core::int};
try {
block {
core::int #t1;
core::int #t2;
final synthesized dynamic #0#0 = obj;
if(!((let final dynamic #t3 = #t1 = #0#0{self::A}.{self::A::foo}{core::int} in true) && (let final dynamic #t4 = #t2 = #0#0{self::A}.{self::A::bar}{core::int} in true)))
throw new core::StateError::•("Pattern matching error");
f = #t1;
b = #t2;
} =>#0#0;
}
on core::Object catch(final core::Object _) {
}
self::expect(1.{core::int::unary-}(){() core::int}, f);
}
static method expect(dynamic expected, dynamic actual) dynamic {
if(!(expected =={core::Object::==}{(core::Object) core::bool} actual))
throw "Expected ${expected}, actual ${actual}";
}