fdc765faad
TEST=existing Change-Id: I0a8fdf09f742b55357411f12dc6164d4050bb83c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196283 Commit-Queue: Johnni Winther <johnniwinther@google.com> Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
61 lines
3.5 KiB
Plaintext
61 lines
3.5 KiB
Plaintext
library;
|
|
import self as self;
|
|
import "dart:core" as core;
|
|
|
|
class A<T extends core::num*> extends core::Object {
|
|
synthetic constructor •() → self::A<self::A::T*>*
|
|
: super core::Object::•()
|
|
;
|
|
method foo() → <S extends self::A::T* = dynamic>(S*) →* void {
|
|
core::print("foo: T = ${self::A::T*}");
|
|
return <S extends self::A::T*>(S* a) → Null {};
|
|
}
|
|
abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
|
|
abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
|
|
abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
|
|
abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
|
|
abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
|
|
abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
|
|
abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
|
|
abstract member-signature method toString() → core::String*; -> core::Object::toString
|
|
abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
|
|
abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
|
|
}
|
|
class B<T extends core::num*> extends core::Object {
|
|
synthetic constructor •() → self::B<self::B::T*>*
|
|
: super core::Object::•()
|
|
;
|
|
method foo() → (self::B::T*) →* void {
|
|
core::print("foo: T = ${self::B::T*}");
|
|
return (self::B::T* a) → Null {};
|
|
}
|
|
abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
|
|
abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
|
|
abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
|
|
abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
|
|
abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
|
|
abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
|
|
abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
|
|
abstract member-signature method toString() → core::String*; -> core::Object::toString
|
|
abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
|
|
abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
|
|
}
|
|
static field self::A<core::num*>* a = new self::A::•<core::int*>();
|
|
static field self::B<core::num*>* b = new self::B::•<core::int*>();
|
|
static method main() → dynamic {
|
|
try {
|
|
self::a.{self::A::foo}() as{TypeError,CovarianceCheck} <S extends core::num* = dynamic>(S*) →* void;
|
|
throw "Expected TypeError";
|
|
}
|
|
on core::TypeError* catch(final core::TypeError* e) {
|
|
core::print(e);
|
|
}
|
|
try {
|
|
self::b.{self::B::foo}() as{TypeError,CovarianceCheck} (core::num*) →* void;
|
|
throw "Expected TypeError";
|
|
}
|
|
on core::TypeError* catch(final core::TypeError* e) {
|
|
core::print(e);
|
|
}
|
|
}
|