| library; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/extension_types/issue54649_2.dart:25:11: Error: The 'await' expression can't be used for an expression with an extension type that is not a subtype of 'Future'. |
| // await x; // Error. |
| // ^ |
| // |
| // pkg/front_end/testcases/extension_types/issue54649_2.dart:41:11: Error: The 'await' expression can't be used for an expression with an extension type that is not a subtype of 'Future'. |
| // await x; // Error. |
| // ^ |
| // |
| import self as self; |
| import "dart:async" as asy; |
| import "dart:core" as core; |
| |
| import "dart:async"; |
| |
| extension type E1(asy::Future<core::int> it) { |
| abstract extension-type-member representation-field get it() → asy::Future<core::int>; |
| constructor • = self::E1|constructor#; |
| constructor tearoff • = self::E1|constructor#_#new#tearOff; |
| } |
| extension type E2(asy::Future<core::int> it) implements self::E1% /* erasure=asy::Future<core::int>, declared=! */, asy::Future<core::int> { |
| abstract extension-type-member representation-field get it() → asy::Future<core::int>; |
| constructor • = self::E2|constructor#; |
| constructor tearoff • = self::E2|constructor#_#new#tearOff; |
| } |
| extension type E3(asy::Future<core::int> it) implements asy::Future<core::int> { |
| abstract extension-type-member representation-field get it() → asy::Future<core::int>; |
| constructor • = self::E3|constructor#; |
| constructor tearoff • = self::E3|constructor#_#new#tearOff; |
| } |
| static extension-type-member method E1|constructor#(asy::Future<core::int> it) → self::E1% /* erasure=asy::Future<core::int>, declared=! */ { |
| lowered final self::E1% /* erasure=asy::Future<core::int>, declared=! */ #this = it; |
| return #this; |
| } |
| static extension-type-member method E1|constructor#_#new#tearOff(asy::Future<core::int> it) → self::E1% /* erasure=asy::Future<core::int>, declared=! */ |
| return self::E1|constructor#(it); |
| static extension-type-member method E2|constructor#(asy::Future<core::int> it) → self::E2 /* erasure=asy::Future<core::int> */ { |
| lowered final self::E2 /* erasure=asy::Future<core::int> */ #this = it; |
| return #this; |
| } |
| static extension-type-member method E2|constructor#_#new#tearOff(asy::Future<core::int> it) → self::E2 /* erasure=asy::Future<core::int> */ |
| return self::E2|constructor#(it); |
| static extension-type-member method E3|constructor#(asy::Future<core::int> it) → self::E3 /* erasure=asy::Future<core::int> */ { |
| lowered final self::E3 /* erasure=asy::Future<core::int> */ #this = it; |
| return #this; |
| } |
| static extension-type-member method E3|constructor#_#new#tearOff(asy::Future<core::int> it) → self::E3 /* erasure=asy::Future<core::int> */ |
| return self::E3|constructor#(it); |
| static method test1<X extends self::E1% /* erasure=asy::Future<core::int>, declared=! */, Y extends self::E2 /* erasure=asy::Future<core::int> */>(self::test1::X% x) → dynamic async /* emittedValueType= dynamic */ { |
| if(x is self::test1::Y) { |
| await x{self::test1::X% & self::test1::Y /* '%' & '!' = '!' */}; |
| } |
| } |
| static method test2<X extends FutureOr<self::E1% /* erasure=asy::Future<core::int>, declared=! */>, Y extends self::E1% /* erasure=asy::Future<core::int>, declared=! */>(self::test2::X% x) → dynamic async /* emittedValueType= dynamic */ { |
| if(x is self::test2::Y%) { |
| await invalid-expression "pkg/front_end/testcases/extension_types/issue54649_2.dart:25:11: Error: The 'await' expression can't be used for an expression with an extension type that is not a subtype of 'Future'. |
| await x; // Error. |
| ^" in x{self::test2::X% & self::test2::Y% /* '%' & '%' = '%' */} /* runtimeCheckType= asy::Future<self::E1% /* erasure=asy::Future<core::int>, declared=! */> */ ; |
| } |
| } |
| static method test3<X extends self::E3? /* erasure=asy::Future<core::int>? */, Y extends self::E3 /* erasure=asy::Future<core::int> */>(self::test3::X% x) → dynamic async /* emittedValueType= dynamic */ { |
| if(x is self::test3::Y) { |
| await x{self::test3::X% & self::test3::Y /* '%' & '!' = '!' */}; |
| } |
| } |
| static method test4<X extends self::E1% /* erasure=asy::Future<core::int>, declared=! */, Y extends self::test4::X% = self::E1% /* erasure=asy::Future<core::int>, declared=! */>(self::test4::X% x) → dynamic async /* emittedValueType= dynamic */ { |
| if(x is self::test4::Y%) { |
| await invalid-expression "pkg/front_end/testcases/extension_types/issue54649_2.dart:41:11: Error: The 'await' expression can't be used for an expression with an extension type that is not a subtype of 'Future'. |
| await x; // Error. |
| ^" in x{self::test4::Y%} /* runtimeCheckType= asy::Future<self::test4::Y%> */ ; |
| } |
| } |