blob: 685afc953e90a4d808903ef310f94cdb0d9e8abd [file] [log] [blame]
library;
import self as self;
import "dart:core" as core;
static method main() dynamic {
self::throws(() void {
if(self::val(10) =={core::num::==}{(core::Object) core::bool} 10 && self::guard(42) as{TypeError,ForDynamic} core::bool) {
core::print("cast on conditions catches non-bools");
}
});
self::throws(() void {
(core::int) r = (10);
{
final synthesized(core::int) #0#0 = r;
if(#C1 =={core::num::==}{(core::Object) core::bool} #0#0.$1{core::int} && self::guard(42) as{TypeError} core::bool) {
core::print("missing cast on conditions allows this code to execute");
}
}
});
}
static method val(core::int x) core::int
return x;
static method guard(dynamic x) dynamic
return x;
static method throws(() void f) dynamic {
try {
f(){() void};
}
on core::Object catch(final core::Object e) {
core::print(e);
return;
}
throw "Missing exception";
}
constants {
#C1 = 10
}
Extra constant evaluation status:
Evaluated: RecordLiteral @ org-dartlang-testcase:///issue51724.dart:12:13 -> RecordConstant(const (10))
Extra constant evaluation: evaluated: 26, effectively constant: 1