blob: 44202c7da5b65182115df5577d0383749df694c7 [file] [log] [blame]
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_infer.dart:13:49: Error: The return type of the method 'B.x' is 'dynamic', which does not match the return type, 'int', of the overridden method, 'A.x'.
// Change to a subtype of 'int'.
// /*error:INVALID_METHOD_OVERRIDE*/ dynamic get x => 3;
// ^
// pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_infer.dart:9:11: Context: This is the overridden method ('x').
// final T x = null;
// ^
//
import self as self;
import "dart:core" as core;
class A<T extends core::Object* = dynamic> extends core::Object {
final field self::A::T* x = null;
synthetic constructor •() self::A<self::A::T*>*
: super core::Object::•()
;
abstract member-signature get _identityHashCode() core::int*;
abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) core::bool*;
abstract member-signature method _simpleInstanceOf(dynamic type) core::bool*;
abstract member-signature method _simpleInstanceOfTrue(dynamic type) core::bool*;
abstract member-signature method _simpleInstanceOfFalse(dynamic type) core::bool*;
abstract member-signature operator ==(dynamic other) core::bool*;
abstract member-signature get hashCode() core::int*;
abstract member-signature method toString() core::String*;
abstract member-signature method noSuchMethod(core::Invocation* invocation) dynamic;
abstract member-signature get runtimeType() core::Type*;
}
class B extends core::Object implements self::A<core::int*> {
synthetic constructor •() self::B*
: super core::Object::•()
;
get x() dynamic
return 3;
abstract member-signature get _identityHashCode() core::int*;
abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) core::bool*;
abstract member-signature method _simpleInstanceOf(dynamic type) core::bool*;
abstract member-signature method _simpleInstanceOfTrue(dynamic type) core::bool*;
abstract member-signature method _simpleInstanceOfFalse(dynamic type) core::bool*;
abstract member-signature operator ==(dynamic other) core::bool*;
abstract member-signature get hashCode() core::int*;
abstract member-signature method toString() core::String*;
abstract member-signature method noSuchMethod(core::Invocation* invocation) dynamic;
abstract member-signature get runtimeType() core::Type*;
}
static method foo() dynamic {
core::String* y = new self::B::•().{self::B::x} as{TypeError,ForDynamic} core::String*;
core::int* z = new self::B::•().{self::B::x} as{TypeError,ForDynamic} core::int*;
}
static method main() dynamic {
self::foo();
}