blob: cd1a2ae6f9444c20b4a19b85f166a101e1e271fc [file] [log] [blame]
library;
import self as self;
import "dart:core" as core;
class A<T extends core::num* = 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* = self::A::T*>(S* a) core::Null? {};
}
}
class B<T extends core::num* = 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) core::Null? {};
}
}
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} <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} (core::num*) →* void;
throw "Expected TypeError";
}
on core::TypeError* catch(final core::TypeError* e) {
core::print(e);
}
}