|
| 1 | +library /*isNonNullableByDefault*/; |
| 2 | +// |
| 3 | +// Problems in library: |
| 4 | +// |
| 5 | +// pkg/front_end/testcases/nnbd/issue42546.dart:14:58: Error: A value of type 'Divergent<int>' can't be returned from an async function with return type 'Future<Divergent<Divergent<Divergent<int>>>>'. |
| 6 | +// - 'Divergent' is from 'pkg/front_end/testcases/nnbd/issue42546.dart'. |
| 7 | +// - 'Future' is from 'dart:async'. |
| 8 | +// Future<Divergent<Divergent<int>>> x = (() async => new Divergent<int>())(); |
| 9 | +// ^ |
| 10 | +// |
| 11 | +// pkg/front_end/testcases/nnbd/issue42546.dart:14:75: Error: A value of type 'Future<Divergent<Divergent<Divergent<int>>>>' can't be assigned to a variable of type 'Future<Divergent<Divergent<int>>>'. |
| 12 | +// - 'Future' is from 'dart:async'. |
| 13 | +// - 'Divergent' is from 'pkg/front_end/testcases/nnbd/issue42546.dart'. |
| 14 | +// Future<Divergent<Divergent<int>>> x = (() async => new Divergent<int>())(); |
| 15 | +// ^ |
| 16 | +// |
| 17 | +import self as self; |
| 18 | +import "dart:core" as core; |
| 19 | +import "dart:async" as asy; |
| 20 | + |
| 21 | +import "dart:async"; |
| 22 | + |
| 23 | +class Divergent<T extends core::Object? = dynamic> extends core::Object implements asy::Future<self::Divergent<self::Divergent<self::Divergent::T%>>> { |
| 24 | + synthetic constructor •() → self::Divergent<self::Divergent::T%> |
| 25 | + : super core::Object::•() |
| 26 | + ; |
| 27 | + method noSuchMethod(core::Invocation invocation) → dynamic |
| 28 | + return super.{core::Object::noSuchMethod}(invocation); |
| 29 | + no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) →? core::bool test = #C1}) → asy::Future<self::Divergent<self::Divergent<self::Divergent::T%>>> |
| 30 | + return this.{self::Divergent::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic,ForNonNullableByDefault} asy::Future<self::Divergent<self::Divergent<self::Divergent::T%>>>; |
| 31 | + no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → FutureOr<void>action) → asy::Future<self::Divergent<self::Divergent<self::Divergent::T%>>> |
| 32 | + return this.{self::Divergent::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic,ForNonNullableByDefault} asy::Future<self::Divergent<self::Divergent<self::Divergent::T%>>>; |
| 33 | + no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () →? FutureOr<self::Divergent<self::Divergent<self::Divergent::T%>>>onTimeout = #C1}) → asy::Future<self::Divergent<self::Divergent<self::Divergent::T%>>> |
| 34 | + return this.{self::Divergent::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C9: onTimeout}))) as{TypeError,ForDynamic,ForNonNullableByDefault} asy::Future<self::Divergent<self::Divergent<self::Divergent::T%>>>; |
| 35 | + no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ then<R extends core::Object? = dynamic>((self::Divergent<self::Divergent<self::Divergent::T%>>) → FutureOr<self::Divergent::then::R%>onValue, {core::Function? onError = #C1}) → asy::Future<self::Divergent::then::R%> |
| 36 | + return this.{self::Divergent::noSuchMethod}(new core::_InvocationMirror::_withType(#C10, 0, core::List::unmodifiable<core::Type*>(<core::Type*>[self::Divergent::then::R%]), core::List::unmodifiable<dynamic>(<dynamic>[onValue]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C11: onError}))) as{TypeError,ForDynamic,ForNonNullableByDefault} asy::Future<self::Divergent::then::R%>; |
| 37 | + no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::Divergent<self::Divergent<self::Divergent::T%>>> |
| 38 | + return this.{self::Divergent::noSuchMethod}(new core::_InvocationMirror::_withType(#C12, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic,ForNonNullableByDefault} asy::Stream<self::Divergent<self::Divergent<self::Divergent::T%>>>; |
| 39 | +} |
| 40 | +static method test() → dynamic async { |
| 41 | + asy::Future<self::Divergent<self::Divergent<core::int>>> x = let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue42546.dart:14:75: Error: A value of type 'Future<Divergent<Divergent<Divergent<int>>>>' can't be assigned to a variable of type 'Future<Divergent<Divergent<int>>>'. |
| 42 | + - 'Future' is from 'dart:async'. |
| 43 | + - 'Divergent' is from 'pkg/front_end/testcases/nnbd/issue42546.dart'. |
| 44 | + Future<Divergent<Divergent<int>>> x = (() async => new Divergent<int>())(); |
| 45 | + ^" in (() → asy::Future<self::Divergent<self::Divergent<self::Divergent<core::int>>>> async => let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue42546.dart:14:58: Error: A value of type 'Divergent<int>' can't be returned from an async function with return type 'Future<Divergent<Divergent<Divergent<int>>>>'. |
| 46 | + - 'Divergent' is from 'pkg/front_end/testcases/nnbd/issue42546.dart'. |
| 47 | + - 'Future' is from 'dart:async'. |
| 48 | + Future<Divergent<Divergent<int>>> x = (() async => new Divergent<int>())(); |
| 49 | + ^" in new self::Divergent::•<core::int>() as{TypeError,ForNonNullableByDefault} self::Divergent<self::Divergent<self::Divergent<core::int>>>).call() as{TypeError,ForNonNullableByDefault} asy::Future<self::Divergent<self::Divergent<core::int>>>; |
| 50 | +} |
| 51 | +static method main() → dynamic {} |
| 52 | + |
| 53 | +constants { |
| 54 | + #C1 = null |
| 55 | + #C2 = #catchError |
| 56 | + #C3 = <core::Type*>[] |
| 57 | + #C4 = #test |
| 58 | + #C5 = #whenComplete |
| 59 | + #C6 = <dynamic>[] |
| 60 | + #C7 = core::_ImmutableMap<core::Symbol*, dynamic> {_kvPairs:#C6} |
| 61 | + #C8 = #timeout |
| 62 | + #C9 = #onTimeout |
| 63 | + #C10 = #then |
| 64 | + #C11 = #onError |
| 65 | + #C12 = #asStream |
| 66 | +} |
0 commit comments