| library; |
| import self as self; |
| import "dart:async" as asy; |
| import "dart:core" as core; |
| |
| extension type V1(asy::Future<core::int> id) implements asy::Future<core::int> { |
| abstract extension-type-member representation-field get id() → asy::Future<core::int>; |
| constructor • = self::V1|constructor#; |
| constructor tearoff • = self::V1|constructor#_#new#tearOff; |
| } |
| extension type V2<T extends asy::Future<core::Object>>(T id) implements asy::Future<core::Object> { |
| abstract extension-type-member representation-field get id() → T; |
| constructor • = self::V2|constructor#; |
| constructor tearoff • = self::V2|constructor#_#new#tearOff; |
| } |
| static extension-type-member method V1|constructor#(asy::Future<core::int> id) → self::V1 /* erasure=asy::Future<core::int> */ { |
| lowered final self::V1 /* erasure=asy::Future<core::int> */ #this = id; |
| return #this; |
| } |
| static extension-type-member method V1|constructor#_#new#tearOff(asy::Future<core::int> id) → self::V1 /* erasure=asy::Future<core::int> */ |
| return self::V1|constructor#(id); |
| static extension-type-member method V2|constructor#<T extends asy::Future<core::Object>>(self::V2|constructor#::T id) → self::V2<self::V2|constructor#::T> /* erasure=self::V2|constructor#::T */ { |
| lowered final self::V2<self::V2|constructor#::T> /* erasure=self::V2|constructor#::T */ #this = id; |
| return #this; |
| } |
| static extension-type-member method V2|constructor#_#new#tearOff<T extends asy::Future<core::Object>>(self::V2|constructor#_#new#tearOff::T id) → self::V2<self::V2|constructor#_#new#tearOff::T> /* erasure=self::V2|constructor#_#new#tearOff::T */ |
| return self::V2|constructor#<self::V2|constructor#_#new#tearOff::T>(id); |
| static method main() → dynamic async /* emittedValueType= dynamic */ { |
| self::V1 /* erasure=asy::Future<core::int> */ v1 = self::V1|constructor#(asy::Future::value<core::int>(42)); |
| core::int _v1 = await v1; |
| self::expect(42, _v1); |
| self::V2<asy::Future<core::String>> /* erasure=asy::Future<core::String> */ v2 = self::V2|constructor#<asy::Future<core::String>>(asy::Future::value<core::String>("42")); |
| core::Object _v2 = await v2; |
| self::expect("42", _v2); |
| } |
| static method expect(dynamic expected, dynamic actual) → dynamic { |
| if(!(expected =={core::Object::==}{(core::Object) → core::bool} actual)) |
| throw "Expected ${expected}, actual ${actual}"; |
| } |