blob: 71fbfaab29ee9ece612a65fdad389cb953bfd748 [file] [log] [blame]
library;
import self as self;
import "dart:core" as core;
typedef Foo<unrelated T extends self::V<core::num, core::Object>% /* erasure=core::num, declared=! */> = (self::V<core::int, core::int>% /* erasure=core::int, declared=! */) self::V<core::int, core::int>% /* erasure=core::int, declared=! */;
typedef IntNumV = self::V<core::int, core::num>% /* erasure=core::int, declared=! */;
class C<T extends self::V<core::num, core::Object>% /* erasure=core::num, declared=! */> extends core::Object {
field (self::V<core::int, core::int>% /* erasure=core::int, declared=! */) self::V<core::int, core::int>% /* erasure=core::int, declared=! */ f = #C2;
synthetic constructor •() self::C<self::C::T%>
: super core::Object::•()
;
}
extension type V<X1 extends core::num, X2 extends core::Object>(X1 id) {
abstract extension-type-member representation-field get id() X1;
constructor = self::V|constructor#;
constructor tearoff = self::V|constructor#_#new#tearOff;
}
static extension-type-member method V|constructor#<X1 extends core::num, X2 extends core::Object>(self::V|constructor#::X1 id) → self::V<self::V|constructor#::X1, self::V|constructor#::X2>% /* erasure=self::V|constructor#::X1, declared=! */ {
lowered final self::V<self::V|constructor#::X1, self::V|constructor#::X2>% /* erasure=self::V|constructor#::X1, declared=! */ #this = id;
return #this;
}
static extension-type-member method V|constructor#_#new#tearOff<X1 extends core::num, X2 extends core::Object>(self::V|constructor#_#new#tearOff::X1 id) → self::V<self::V|constructor#_#new#tearOff::X1, self::V|constructor#_#new#tearOff::X2>% /* erasure=self::V|constructor#_#new#tearOff::X1, declared=! */
return self::V|constructor#<self::V|constructor#_#new#tearOff::X1, self::V|constructor#_#new#tearOff::X2>(id);
static method foo<T extends self::V<core::num, core::Object>% /* erasure=core::num, declared=! */>(self::foo::T% t) self::V<core::int, core::int>% /* erasure=core::int, declared=! */
return t as self::V<core::int, core::int>% /* erasure=core::int, declared=! */;
static method main() dynamic {
self::V<core::int, core::num>% /* erasure=core::int, declared=! */ v = self::V|constructor#<core::int, core::num>(42);
self::expect(42, v as{Unchecked} core::int);
self::expect(v, self::foo<self::V<core::int, core::num>% /* erasure=core::int, declared=! */>(v));
self::expect(self::V|constructor#<core::int, core::int>(0), let final self::C<self::V<core::int, core::int>% /* erasure=core::int, declared=! */> #t1 = new self::C::•<self::V<core::int, core::int>% /* erasure=core::int, declared=! */>() in let final self::V<core::int, core::int>% /* erasure=core::int, declared=! */ #t2 = self::V|constructor#<core::int, core::int>(0) in #t1.{self::C::f}{(self::V<core::int, core::int>% /* erasure=core::int, declared=! */) → self::V<core::int, core::int>% /* erasure=core::int, declared=! */}(#t2){(self::V<core::int, core::int>% /* erasure=core::int, declared=! */) → self::V<core::int, core::int>% /* erasure=core::int, declared=! */});
self::expect(self::V|constructor#<core::int, core::Object>(1), let final self::C<self::V<core::int, core::int>% /* erasure=core::int, declared=! */> #t3 = new self::C::•<self::V<core::int, core::int>% /* erasure=core::int, declared=! */>() in let final self::V<core::int, core::int>% /* erasure=core::int, declared=! */ #t4 = self::V|constructor#<core::int, core::int>(1) in #t3.{self::C::f}{(self::V<core::int, core::int>% /* erasure=core::int, declared=! */) → self::V<core::int, core::int>% /* erasure=core::int, declared=! */}(#t4){(self::V<core::int, core::int>% /* erasure=core::int, declared=! */) → self::V<core::int, core::int>% /* erasure=core::int, declared=! */});
}
static method expect(dynamic expected, dynamic actual) dynamic {
if(!(expected =={core::Object::==}{(core::Object) core::bool} actual))
throw "Expected ${expected}, actual ${actual}";
}
constants {
#C1 = static-tearoff self::foo
#C2 = instantiation #C1 <core::int>
}