blob: 3b8a767d4deb2ebe2d730b9a1825365a7f9586bb [file] [log] [blame]
library;
import self as self;
import "dart:core" as core;
abstract class A<X extends core::Object = dynamic> extends core::Object {
generic-covariant-impl field core::List<self::A::X> foo = null;
synthetic constructor •() void
: super core::Object::•()
;
}
class B extends core::Object implements self::A<core::int> {
synthetic constructor •() void
: super core::Object::•()
;
method noSuchMethod(core::Invocation i) dynamic
return <dynamic>[];
no-such-method-forwarder get foo() core::List<core::int>
return this.{self::B::noSuchMethod}(new core::_InvocationMirror::_withoutType("get:foo", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} core::List<core::int>;
no-such-method-forwarder set foo(core::List<core::int> value) void
return this.{self::B::noSuchMethod}(new core::_InvocationMirror::_withoutType("set:foo", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[value]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false));
}
static method expectTypeError(() dynamic callback) void {
try {
callback.call();
throw "Expected TypeError, did not occur";
}
on core::TypeError catch(no-exception-var) {
}
}
static method main() dynamic {
self::B b = new self::B::•();
self::expectTypeError(() core::List<core::int> => b.{self::B::foo});
self::expectTypeError(() core::List<dynamic> => (b as dynamic).foo = <dynamic>[]);
}