blob: 4b64468f9d91d5c8690506fd599e8e5ab39e6ffe [file] [log] [blame]
library;
import self as self;
import "dart:core" as core;
typedef ContraFunction<contravariant T extends core::Object* = dynamic> = (T*) →* void;
typedef InvFunction<invariant T extends core::Object* = dynamic> = (T*) →* T*;
class Contravariant<contravariant T extends core::Object* = dynamic> extends core::Object {
synthetic constructor •() self::Contravariant<self::Contravariant::T*>*
: super core::Object::•()
;
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 Invariant<invariant T extends core::Object* = dynamic> extends core::Object {
synthetic constructor •() self::Invariant<self::Invariant::T*>*
: super core::Object::•()
;
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 A<contravariant T extends core::Object* = dynamic, U extends core::Object* = dynamic, V extends core::Object* = dynamic> extends core::Object {
final field (self::A::T*) →* void field = null;
synthetic constructor •() self::A<self::A::T*, self::A::U*, self::A::V*>*
: super core::Object::•()
;
method method(self::A::T* t, (self::A::U*) →* void u, generic-covariant-impl self::A::V* v) void {}
method method2(self::A::T* x, [self::A::T* y = #C1]) → void {}
set x(self::A::T* t) void {}
get mapContra() core::Map<self::A::U*, self::Contravariant<self::A::V*>*>*
return core::Map::•<self::A::U*, self::Contravariant<self::A::V*>*>();
get mapContraFn() core::Map<self::A::U*, (self::A::V*) →* void>*
return core::Map::•<self::A::U*, (self::A::V*) →* void>();
get mapInv() core::Map<self::A::U*, self::Invariant<self::A::V*>*>*
return core::Map::•<self::A::U*, self::Invariant<self::A::V*>*>();
get mapInvFn() core::Map<self::A::U*, (self::A::V*) →* self::A::V*>*
return core::Map::•<self::A::U*, (self::A::V*) →* self::A::V*>();
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<invariant T extends core::Object* = dynamic> extends core::Object {
field self::B::T* x = null;
synthetic constructor •() self::B<self::B::T*>*
: super core::Object::•()
;
method method(self::B::T* x) self::B::T*
return x;
set y(self::B::T* x) void {}
abstract member-signature method noSuchMethod(core::Invocation* invocation) dynamic; -> core::Object::noSuchMethod
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 get runtimeType() core::Type*; -> core::Object::runtimeType
}
class C<contravariant T extends core::Object* = dynamic> extends core::Object {
final field (self::C::T*) →* void field = null;
synthetic constructor •() self::C<self::C::T*>*
: super core::Object::•()
;
method method(self::C::T* x, [self::C::T* y = #C1]) → void {}
set x(self::C::T* t) void {}
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
}
abstract class D<T extends core::Object* = dynamic> extends core::Object {
synthetic constructor •() self::D<self::D::T*>*
: super core::Object::•()
;
abstract method method(generic-covariant-impl self::D::T* x) core::int*;
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 E<invariant T extends core::Object* = dynamic> extends core::Object {
final field (self::E::T*) →* void f;
constructor •((self::E::T*) →* void f) self::E<self::E::T*>*
: self::E::f = f, super core::Object::•()
;
method method(self::E::T* x) core::int* {
let final self::E::T* #t1 = x in this.{self::E::f}.call(#t1);
}
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 F<invariant T extends core::Object* = dynamic> extends self::E<self::F::T*> implements self::D<self::F::T*> {
constructor •((self::F::T*) →* void f) self::F<self::F::T*>*
: super self::E::•(f)
;
forwarding-stub method method(generic-covariant-impl self::F::T* x) core::int*
return super.{self::E::method}(x);
}
class NoSuchMethod<invariant T extends core::Object* = dynamic> extends core::Object implements self::B<self::NoSuchMethod::T*> {
synthetic constructor •() self::NoSuchMethod<self::NoSuchMethod::T*>*
: super core::Object::•()
;
method noSuchMethod(core::Invocation* _) dynamic
return 3;
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 get runtimeType() core::Type*; -> core::Object::runtimeType
no-such-method-forwarder get x() self::NoSuchMethod::T*
return this.{self::NoSuchMethod::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 1, #C3, #C4, core::Map::unmodifiable<core::Symbol*, dynamic>(#C5))) as{TypeError,ForDynamic} self::NoSuchMethod::T*;
no-such-method-forwarder method method(self::NoSuchMethod::T* x) self::NoSuchMethod::T*
return this.{self::NoSuchMethod::noSuchMethod}(new core::_InvocationMirror::_withType(#C6, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[x]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C5))) as{TypeError,ForDynamic} self::NoSuchMethod::T*;
no-such-method-forwarder set y(self::NoSuchMethod::T* x) void
return this.{self::NoSuchMethod::noSuchMethod}(new core::_InvocationMirror::_withType(#C7, 2, #C3, core::List::unmodifiable<dynamic>(<dynamic>[x]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C5)));
no-such-method-forwarder set x(self::NoSuchMethod::T* value) void
return this.{self::NoSuchMethod::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 2, #C3, core::List::unmodifiable<dynamic>(<dynamic>[value]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C5)));
}
static method main() dynamic {
self::A<core::int*, core::num*, core::String*>* a = new self::A::•<core::int*, core::num*, core::String*>();
self::expect(null, a.{self::A::field});
a.{self::A::method}(3, (core::num* num) Null {}, "test");
a.{self::A::method2}(3);
a.{self::A::x} = 3;
core::Map<core::num*, self::Contravariant<core::String*>*>* mapContra = a.{self::A::mapContra} as{TypeError,CovarianceCheck} core::Map<core::num*, self::Contravariant<core::String*>*>*;
core::Map<core::num*, (core::String*) →* void>* mapContraFn = a.{self::A::mapContraFn} as{TypeError,CovarianceCheck} core::Map<core::num*, (core::String*) →* void>*;
core::Map<core::num*, self::Invariant<core::String*>*>* mapInv = a.{self::A::mapInv} as{TypeError,CovarianceCheck} core::Map<core::num*, self::Invariant<core::String*>*>*;
core::Map<core::num*, (core::String*) →* core::String*>* mapInvFn = a.{self::A::mapInvFn} as{TypeError,CovarianceCheck} core::Map<core::num*, (core::String*) →* core::String*>*;
self::B<core::int*>* b = new self::B::•<core::int*>();
b.{self::B::x} = 3;
self::expect(3, b.{self::B::x});
self::expect(3, b.{self::B::method}(3));
b.{self::B::y} = 3;
self::C<core::int*>* c = new self::C::•<core::int*>();
self::expect(null, c.{self::C::field});
c.{self::C::method}(3, 2);
c.{self::C::x} = 3;
self::D<core::Object*>* d = new self::F::•<core::String*>((core::String* s) Null {});
d.{self::D::method}("test");
self::NoSuchMethod<core::num*>* nsm = new self::NoSuchMethod::•<core::num*>();
self::expect(3, nsm.{self::B::method}(3));
}
static method expect(dynamic expected, dynamic actual) dynamic {
if(!expected.{core::Object::==}(actual)) {
throw "Mismatch: expected=${expected}, actual=${actual}";
}
}
constants {
#C1 = null
#C2 = #x
#C3 = <core::Type*>[]
#C4 = <dynamic>[]
#C5 = core::_ImmutableMap<core::Symbol*, dynamic> {_kvPairs:#C4}
#C6 = #method
#C7 = #y=
#C8 = #x=
}