blob: 989a27b4a1496d188aad6e9e620dbc22f3309276 [file] [log] [blame]
library;
import self as self;
import "dart:core" as core;
class A<X extends core::num> extends core::Object {
synthetic constructor •() self::A<self::A::X>
: super core::Object::•()
;
method f<covariant-by-class Y extends self::A::X>(self::A::f::Y y) void {}
}
static method expectThrows(() void f) dynamic {
try {
f(){() void};
}
on core::Object catch(final core::Object e) {
return;
}
throw "Expected an exception to be thrown!";
}
static method main() dynamic {
self::A<core::num> a = new self::A::•<core::int>();
self::expectThrows(() void {
<Y extends core::num>(Y) void f = a.{self::A::f}{<Y extends core::num>(Y) void} as{TypeError,CovarianceCheck} <Y extends core::num>(Y) void;
});
}