1
0
mirror of https://github.com/dart-lang/sdk synced 2024-07-03 00:08:46 +00:00

Enable feature inference-update-3.

In discussion with the language team, we've decided to ship this
feature in Dart 3.4. This CL contains a minimal CHANGELOG entry for
the feature; I plan to expand on it once I'm finished with the feature
specification document.

Change-Id: Iac86ebed322feb8e478bf5a6780d50adb433ed7f
Tested: trybots
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/355900
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This commit is contained in:
Paul Berry 2024-03-13 22:04:23 +00:00 committed by Commit Queue
parent a1726f82ff
commit fb210554eb
58 changed files with 165 additions and 1364 deletions

View File

@ -2,6 +2,15 @@
### Language
Dart 3.4 makes improvements to the type analysis of conditional expressions
(`e1 ? e2 : e3`), if-null expressions (`e1 ?? e2`), if-null assignments
(`e1 ??= e2`), and switch expressions (`switch (e) { p1 => e1, ... }`). To take
advantage of these improvements, set your package's
[SDK constraint][language version] lower bound to 3.4 or greater
(`sdk: '^3.4.0'`).
[language version]: https://dart.dev/guides/language/evolution
- **Breaking Change** [#54640][]: The pattern context type schema for
cast patterns has been changed from `Object?` to `_` (the unknown
type), to align with the specification. This change is not expected

View File

@ -82,10 +82,10 @@ enum ExperimentalFlag {
inferenceUpdate3(
name: 'inference-update-3',
isEnabledByDefault: false,
isEnabledByDefault: true,
isExpired: false,
experimentEnabledVersion: defaultLanguageVersion,
experimentReleasedVersion: defaultLanguageVersion),
experimentEnabledVersion: const Version(3, 4),
experimentReleasedVersion: const Version(3, 4)),
inlineClass(
name: 'inline-class',

View File

@ -250,7 +250,7 @@ class ExperimentalFeatures {
documentation:
'Better handling of conditional expressions, and switch expressions.',
experimentalReleaseVersion: null,
releaseVersion: null,
releaseVersion: Version.parse('3.4.0'),
);
static final inline_class = ExperimentalFeature(
@ -459,7 +459,7 @@ class IsEnabledByDefault {
static const bool inference_update_2 = true;
/// Default state of the experiment "inference-update-3"
static const bool inference_update_3 = false;
static const bool inference_update_3 = true;
/// Default state of the experiment "inline-class"
static const bool inline_class = true;

View File

@ -342,6 +342,7 @@ analysisOptions
generic-metadata
inference-update-1
inference-update-2
inference-update-3
inline-class
named-arguments-anywhere
non-nullable
@ -414,6 +415,7 @@ analysisOptions
generic-metadata
inference-update-1
inference-update-2
inference-update-3
inline-class
named-arguments-anywhere
non-nullable

View File

@ -319,6 +319,7 @@ AssignmentExpression
test_ifNull_lubUsedEvenIfItDoesNotSatisfyContext() async {
await assertNoErrorsInCode('''
// @dart=3.3
f(Object? o1, Object? o2, List<num> listNum) {
if (o1 is Iterable<int>? && o2 is Iterable<num>) {
o2 = (o1 ??= listNum);

View File

@ -266,6 +266,7 @@ BinaryExpression
test_ifNull_lubUsedEvenIfItDoesNotSatisfyContext() async {
await assertNoErrorsInCode('''
// @dart=3.3
class A {}
class B1 extends A {}
class B2 extends A {}

View File

@ -107,6 +107,7 @@ ConditionalExpression
test_ifNull_lubUsedEvenIfItDoesNotSatisfyContext() async {
await assertNoErrorsInCode('''
// @dart=3.3
class A {}
class B1 extends A {}
class B2 extends A {}

View File

@ -1999,19 +1999,16 @@ void main() {
.NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE,
387,
1),
error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 457, 38),
error(
CompileTimeErrorCode
.NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE,
519,
1),
error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 540, 32),
error(
CompileTimeErrorCode
.NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE,
594,
1),
error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 620, 32),
]);
await disposeAnalysisContextCollection();
@ -2031,19 +2028,16 @@ void main() {
.NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE,
389,
1),
error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 459, 40),
error(
CompileTimeErrorCode
.NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE,
523,
1),
error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 544, 34),
error(
CompileTimeErrorCode
.NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE,
600,
1),
error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 626, 34),
]);
await disposeAnalysisContextCollection();
@ -2063,19 +2057,16 @@ void main() {
.NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE,
391,
1),
error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 461, 38),
error(
CompileTimeErrorCode
.NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE,
525,
1),
error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 546, 32),
error(
CompileTimeErrorCode
.NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE,
602,
1),
error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 628, 32),
]);
await disposeAnalysisContextCollection();
@ -2098,22 +2089,16 @@ void main() {
.NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE,
393,
1),
error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 463,
40),
error(
CompileTimeErrorCode
.NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE,
529,
1),
error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 550,
34),
error(
CompileTimeErrorCode
.NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE,
608,
1),
error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 634,
34),
]);
await disposeAnalysisContextCollection();
@ -2133,19 +2118,16 @@ void main() {
.NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE,
387,
1),
error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 457, 40),
error(
CompileTimeErrorCode
.NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE,
521,
1),
error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 542, 34),
error(
CompileTimeErrorCode
.NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE,
598,
1),
error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 624, 34),
]);
await disposeAnalysisContextCollection();
@ -2165,19 +2147,16 @@ void main() {
.NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE,
385,
1),
error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 455, 38),
error(
CompileTimeErrorCode
.NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE,
517,
1),
error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 538, 32),
error(
CompileTimeErrorCode
.NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE,
592,
1),
error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 618, 32),
]);
await disposeAnalysisContextCollection();
}
@ -2364,8 +2343,6 @@ $downwards<int> g3(bool x) async {
contextMessages: [message(dartAsyncFile, 506, 4)]),
error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 223, 7),
error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 236, 4),
error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 285, 29),
error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 352, 29),
error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 464, 1),
]);
await disposeAnalysisContextCollection();
@ -2375,8 +2352,6 @@ $downwards<int> g3(bool x) async {
contextMessages: [message(dartAsyncFile, 506, 4)]),
error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 223, 7),
error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 236, 4),
error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 285, 31),
error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 354, 31),
error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 470, 1),
]);
await disposeAnalysisContextCollection();

View File

@ -141,11 +141,11 @@ class ExperimentalFlag {
static const ExperimentalFlag inferenceUpdate3 = const ExperimentalFlag(
name: 'inference-update-3',
isEnabledByDefault: false,
isEnabledByDefault: true,
isExpired: false,
enabledVersion: defaultLanguageVersion,
experimentEnabledVersion: defaultLanguageVersion,
experimentReleasedVersion: defaultLanguageVersion);
enabledVersion: const Version(3, 4),
experimentEnabledVersion: const Version(3, 4),
experimentReleasedVersion: const Version(3, 4));
static const ExperimentalFlag inlineClass = const ExperimentalFlag(
name: 'inline-class',

View File

@ -24,7 +24,6 @@ void test(MyFuture<bool> f) {
});
Future<int> t5 = f. /*@typeArgs=int*/ /*@target=MyFuture.then*/ then(
/*@returnType=FutureOr<int>*/ (/*@type=bool*/ x) =>
// error:INVALID_CAST_FUNCTION_EXPR
x ? 2 : new Future<int>.value(3));
Future<int> t6 = f. /*@typeArgs=int*/ /*@target=MyFuture.then*/ then(
/*@returnType=FutureOr<int>*/ (/*@type=bool*/ x) {

View File

@ -1,23 +1,4 @@
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_then_conditional2.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// return /*info:DOWN_CAST_COMPOSITE*/ await x ? 2 : new Future<int>.value(3);
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ? 2 : new Future<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new Future<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -45,21 +26,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(self::MyFuture<core::bool> f) → void {
asy::Future<core::int> t1 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ => x ?{core::int} 2 : await asy::Future::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t2 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
return /*info:DOWN_CAST_COMPOSITE*/ await x ? 2 : new Future<int>.value(3);
^" in (await x /* runtimeCheckType= asy::Future<core::bool> */ ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} core::int;
return await x /* runtimeCheckType= asy::Future<core::bool> */ ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ? 2 : new Future<int>.value(3));
^" in (x ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} FutureOr<core::int>){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => x ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t6 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new Future<int>.value(3);
^" in (x ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} FutureOr<core::int>;
return x ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
}
static method main() → dynamic {}

View File

@ -1,23 +1,4 @@
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_then_conditional2.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// return /*info:DOWN_CAST_COMPOSITE*/ await x ? 2 : new Future<int>.value(3);
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ? 2 : new Future<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new Future<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -45,21 +26,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(self::MyFuture<core::bool> f) → void {
asy::Future<core::int> t1 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ => x ?{core::int} 2 : await asy::Future::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t2 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
return /*info:DOWN_CAST_COMPOSITE*/ await x ? 2 : new Future<int>.value(3);
^" in (await x /* runtimeCheckType= asy::Future<core::bool> */ ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} core::int;
return await x /* runtimeCheckType= asy::Future<core::bool> */ ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ? 2 : new Future<int>.value(3));
^" in (x ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} FutureOr<core::int>){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => x ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t6 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new Future<int>.value(3);
^" in (x ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} FutureOr<core::int>;
return x ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
}
static method main() → dynamic {}

View File

@ -1,23 +1,4 @@
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_then_conditional2.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// return /*info:DOWN_CAST_COMPOSITE*/ await x ? 2 : new Future<int>.value(3);
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ? 2 : new Future<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new Future<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -45,21 +26,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(self::MyFuture<core::bool> f) → void {
asy::Future<core::int> t1 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ => x ?{core::int} 2 : await asy::Future::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t2 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
return /*info:DOWN_CAST_COMPOSITE*/ await x ? 2 : new Future<int>.value(3);
^" in (await x /* runtimeCheckType= asy::Future<core::bool> */ ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} core::int;
return await x /* runtimeCheckType= asy::Future<core::bool> */ ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ? 2 : new Future<int>.value(3));
^" in (x ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} FutureOr<core::int>){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => x ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t6 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new Future<int>.value(3);
^" in (x ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} FutureOr<core::int>;
return x ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
}
static method main() → dynamic {}

View File

@ -1,23 +1,4 @@
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_then_conditional2.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// return /*info:DOWN_CAST_COMPOSITE*/ await x ? 2 : new Future<int>.value(3);
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ? 2 : new Future<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new Future<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -45,21 +26,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(self::MyFuture<core::bool> f) → void {
asy::Future<core::int> t1 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ => x ?{core::int} 2 : await asy::Future::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t2 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
return /*info:DOWN_CAST_COMPOSITE*/ await x ? 2 : new Future<int>.value(3);
^" in (await x /* runtimeCheckType= asy::Future<core::bool> */ ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} core::int;
return await x /* runtimeCheckType= asy::Future<core::bool> */ ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ? 2 : new Future<int>.value(3));
^" in (x ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} FutureOr<core::int>){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => x ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t6 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new Future<int>.value(3);
^" in (x ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} FutureOr<core::int>;
return x ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
}
static method main() → dynamic {}

View File

@ -1,23 +1,4 @@
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_then_conditional2.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// return /*info:DOWN_CAST_COMPOSITE*/ await x ? 2 : new Future<int>.value(3);
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ? 2 : new Future<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new Future<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -45,21 +26,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(self::MyFuture<core::bool> f) → void {
asy::Future<core::int> t1 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ => x ?{core::int} 2 : await asy::Future::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t2 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
return /*info:DOWN_CAST_COMPOSITE*/ await x ? 2 : new Future<int>.value(3);
^" in (await x /* runtimeCheckType= asy::Future<core::bool> */ ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} core::int;
return await x /* runtimeCheckType= asy::Future<core::bool> */ ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ? 2 : new Future<int>.value(3));
^" in (x ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} FutureOr<core::int>){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => x ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t6 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new Future<int>.value(3);
^" in (x ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} FutureOr<core::int>;
return x ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
}
static method main() → dynamic {}

View File

@ -1,23 +1,4 @@
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_then_conditional2_2.dart:24:9: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 2
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_2.dart:30:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ? 2 : new MyFuture<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_2.dart:33:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new MyFuture<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -45,21 +26,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(self::MyFuture<core::bool> f) → void {
asy::Future<core::int> t1 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ => x ?{core::int} 2 : await new self::MyFuture::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t2 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_2.dart:24:9: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 2
^" in (await x /* runtimeCheckType= asy::Future<core::bool> */ ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} core::int;
return await x /* runtimeCheckType= asy::Future<core::bool> */ ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_2.dart:30:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ? 2 : new MyFuture<int>.value(3));
^" in (x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} FutureOr<core::int>){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => x ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t6 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_2.dart:33:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new MyFuture<int>.value(3);
^" in (x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} FutureOr<core::int>;
return x ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
}
static method main() → dynamic {}

View File

@ -1,23 +1,4 @@
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_then_conditional2_2.dart:24:9: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 2
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_2.dart:30:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ? 2 : new MyFuture<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_2.dart:33:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new MyFuture<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -45,21 +26,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(self::MyFuture<core::bool> f) → void {
asy::Future<core::int> t1 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ => x ?{core::int} 2 : await new self::MyFuture::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t2 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_2.dart:24:9: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 2
^" in (await x /* runtimeCheckType= asy::Future<core::bool> */ ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} core::int;
return await x /* runtimeCheckType= asy::Future<core::bool> */ ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_2.dart:30:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ? 2 : new MyFuture<int>.value(3));
^" in (x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} FutureOr<core::int>){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => x ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t6 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_2.dart:33:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new MyFuture<int>.value(3);
^" in (x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} FutureOr<core::int>;
return x ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
}
static method main() → dynamic {}

View File

@ -1,23 +1,4 @@
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_then_conditional2_2.dart:24:9: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 2
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_2.dart:30:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ? 2 : new MyFuture<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_2.dart:33:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new MyFuture<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -45,21 +26,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(self::MyFuture<core::bool> f) → void {
asy::Future<core::int> t1 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ => x ?{core::int} 2 : await new self::MyFuture::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t2 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_2.dart:24:9: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 2
^" in (await x /* runtimeCheckType= asy::Future<core::bool> */ ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} core::int;
return await x /* runtimeCheckType= asy::Future<core::bool> */ ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_2.dart:30:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ? 2 : new MyFuture<int>.value(3));
^" in (x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} FutureOr<core::int>){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => x ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t6 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_2.dart:33:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new MyFuture<int>.value(3);
^" in (x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} FutureOr<core::int>;
return x ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
}
static method main() → dynamic {}

View File

@ -1,23 +1,4 @@
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_then_conditional2_2.dart:24:9: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 2
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_2.dart:30:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ? 2 : new MyFuture<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_2.dart:33:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new MyFuture<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -45,21 +26,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(self::MyFuture<core::bool> f) → void {
asy::Future<core::int> t1 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ => x ?{core::int} 2 : await new self::MyFuture::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t2 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_2.dart:24:9: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 2
^" in (await x /* runtimeCheckType= asy::Future<core::bool> */ ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} core::int;
return await x /* runtimeCheckType= asy::Future<core::bool> */ ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_2.dart:30:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ? 2 : new MyFuture<int>.value(3));
^" in (x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} FutureOr<core::int>){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => x ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t6 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_2.dart:33:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new MyFuture<int>.value(3);
^" in (x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} FutureOr<core::int>;
return x ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
}
static method main() → dynamic {}

View File

@ -1,23 +1,4 @@
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_then_conditional2_2.dart:24:9: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 2
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_2.dart:30:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ? 2 : new MyFuture<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_2.dart:33:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new MyFuture<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -45,21 +26,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(self::MyFuture<core::bool> f) → void {
asy::Future<core::int> t1 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ => x ?{core::int} 2 : await new self::MyFuture::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t2 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_2.dart:24:9: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 2
^" in (await x /* runtimeCheckType= asy::Future<core::bool> */ ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} core::int;
return await x /* runtimeCheckType= asy::Future<core::bool> */ ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_2.dart:30:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ? 2 : new MyFuture<int>.value(3));
^" in (x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} FutureOr<core::int>){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => x ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t6 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_2.dart:33:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new MyFuture<int>.value(3);
^" in (x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} FutureOr<core::int>;
return x ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
}
static method main() → dynamic {}

View File

@ -1,23 +1,4 @@
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_then_conditional2_3.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// return /*info:DOWN_CAST_COMPOSITE*/ await x ? 2 : new Future<int>.value(3);
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_3.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ? 2 : new Future<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_3.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new Future<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -45,21 +26,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(self::MyFuture<core::bool> f) → void {
self::MyFuture<core::int> t1 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ => x ?{core::int} 2 : await asy::Future::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t2 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_3.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
return /*info:DOWN_CAST_COMPOSITE*/ await x ? 2 : new Future<int>.value(3);
^" in (await x /* runtimeCheckType= asy::Future<core::bool> */ ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} core::int;
return await x /* runtimeCheckType= asy::Future<core::bool> */ ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_3.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ? 2 : new Future<int>.value(3));
^" in (x ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} FutureOr<core::int>){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => x ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t6 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_3.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new Future<int>.value(3);
^" in (x ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} FutureOr<core::int>;
return x ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
}
static method main() → dynamic {}

View File

@ -1,23 +1,4 @@
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_then_conditional2_3.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// return /*info:DOWN_CAST_COMPOSITE*/ await x ? 2 : new Future<int>.value(3);
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_3.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ? 2 : new Future<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_3.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new Future<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -45,21 +26,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(self::MyFuture<core::bool> f) → void {
self::MyFuture<core::int> t1 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ => x ?{core::int} 2 : await asy::Future::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t2 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_3.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
return /*info:DOWN_CAST_COMPOSITE*/ await x ? 2 : new Future<int>.value(3);
^" in (await x /* runtimeCheckType= asy::Future<core::bool> */ ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} core::int;
return await x /* runtimeCheckType= asy::Future<core::bool> */ ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_3.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ? 2 : new Future<int>.value(3));
^" in (x ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} FutureOr<core::int>){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => x ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t6 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_3.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new Future<int>.value(3);
^" in (x ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} FutureOr<core::int>;
return x ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
}
static method main() → dynamic {}

View File

@ -1,23 +1,4 @@
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_then_conditional2_3.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// return /*info:DOWN_CAST_COMPOSITE*/ await x ? 2 : new Future<int>.value(3);
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_3.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ? 2 : new Future<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_3.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new Future<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -45,21 +26,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(self::MyFuture<core::bool> f) → void {
self::MyFuture<core::int> t1 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ => x ?{core::int} 2 : await asy::Future::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t2 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_3.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
return /*info:DOWN_CAST_COMPOSITE*/ await x ? 2 : new Future<int>.value(3);
^" in (await x /* runtimeCheckType= asy::Future<core::bool> */ ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} core::int;
return await x /* runtimeCheckType= asy::Future<core::bool> */ ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_3.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ? 2 : new Future<int>.value(3));
^" in (x ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} FutureOr<core::int>){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => x ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t6 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_3.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new Future<int>.value(3);
^" in (x ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} FutureOr<core::int>;
return x ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
}
static method main() → dynamic {}

View File

@ -1,23 +1,4 @@
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_then_conditional2_3.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// return /*info:DOWN_CAST_COMPOSITE*/ await x ? 2 : new Future<int>.value(3);
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_3.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ? 2 : new Future<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_3.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new Future<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -45,21 +26,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(self::MyFuture<core::bool> f) → void {
self::MyFuture<core::int> t1 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ => x ?{core::int} 2 : await asy::Future::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t2 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_3.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
return /*info:DOWN_CAST_COMPOSITE*/ await x ? 2 : new Future<int>.value(3);
^" in (await x /* runtimeCheckType= asy::Future<core::bool> */ ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} core::int;
return await x /* runtimeCheckType= asy::Future<core::bool> */ ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_3.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ? 2 : new Future<int>.value(3));
^" in (x ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} FutureOr<core::int>){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => x ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t6 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_3.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new Future<int>.value(3);
^" in (x ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} FutureOr<core::int>;
return x ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
}
static method main() → dynamic {}

View File

@ -1,23 +1,4 @@
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_then_conditional2_3.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// return /*info:DOWN_CAST_COMPOSITE*/ await x ? 2 : new Future<int>.value(3);
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_3.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ? 2 : new Future<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_3.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new Future<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -45,21 +26,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(self::MyFuture<core::bool> f) → void {
self::MyFuture<core::int> t1 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ => x ?{core::int} 2 : await asy::Future::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t2 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_3.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
return /*info:DOWN_CAST_COMPOSITE*/ await x ? 2 : new Future<int>.value(3);
^" in (await x /* runtimeCheckType= asy::Future<core::bool> */ ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} core::int;
return await x /* runtimeCheckType= asy::Future<core::bool> */ ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_3.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ? 2 : new Future<int>.value(3));
^" in (x ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} FutureOr<core::int>){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => x ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t6 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_3.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new Future<int>.value(3);
^" in (x ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} FutureOr<core::int>;
return x ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
}
static method main() → dynamic {}

View File

@ -1,23 +1,4 @@
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_then_conditional2_4.dart:24:9: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 2
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_4.dart:30:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ? 2 : new MyFuture<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_4.dart:33:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new MyFuture<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -45,21 +26,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(self::MyFuture<core::bool> f) → void {
self::MyFuture<core::int> t1 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ => x ?{core::int} 2 : await new self::MyFuture::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t2 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_4.dart:24:9: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 2
^" in (await x /* runtimeCheckType= asy::Future<core::bool> */ ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} core::int;
return await x /* runtimeCheckType= asy::Future<core::bool> */ ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_4.dart:30:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ? 2 : new MyFuture<int>.value(3));
^" in (x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} FutureOr<core::int>){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => x ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t6 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_4.dart:33:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new MyFuture<int>.value(3);
^" in (x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} FutureOr<core::int>;
return x ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
}
static method main() → dynamic {}

View File

@ -1,23 +1,4 @@
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_then_conditional2_4.dart:24:9: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 2
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_4.dart:30:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ? 2 : new MyFuture<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_4.dart:33:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new MyFuture<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -45,21 +26,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(self::MyFuture<core::bool> f) → void {
self::MyFuture<core::int> t1 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ => x ?{core::int} 2 : await new self::MyFuture::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t2 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_4.dart:24:9: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 2
^" in (await x /* runtimeCheckType= asy::Future<core::bool> */ ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} core::int;
return await x /* runtimeCheckType= asy::Future<core::bool> */ ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_4.dart:30:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ? 2 : new MyFuture<int>.value(3));
^" in (x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} FutureOr<core::int>){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => x ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t6 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_4.dart:33:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new MyFuture<int>.value(3);
^" in (x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} FutureOr<core::int>;
return x ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
}
static method main() → dynamic {}

View File

@ -1,23 +1,4 @@
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_then_conditional2_4.dart:24:9: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 2
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_4.dart:30:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ? 2 : new MyFuture<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_4.dart:33:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new MyFuture<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -45,21 +26,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(self::MyFuture<core::bool> f) → void {
self::MyFuture<core::int> t1 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ => x ?{core::int} 2 : await new self::MyFuture::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t2 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_4.dart:24:9: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 2
^" in (await x /* runtimeCheckType= asy::Future<core::bool> */ ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} core::int;
return await x /* runtimeCheckType= asy::Future<core::bool> */ ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_4.dart:30:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ? 2 : new MyFuture<int>.value(3));
^" in (x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} FutureOr<core::int>){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => x ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t6 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_4.dart:33:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new MyFuture<int>.value(3);
^" in (x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} FutureOr<core::int>;
return x ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
}
static method main() → dynamic {}

View File

@ -1,23 +1,4 @@
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_then_conditional2_4.dart:24:9: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 2
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_4.dart:30:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ? 2 : new MyFuture<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_4.dart:33:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new MyFuture<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -45,21 +26,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(self::MyFuture<core::bool> f) → void {
self::MyFuture<core::int> t1 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ => x ?{core::int} 2 : await new self::MyFuture::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t2 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_4.dart:24:9: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 2
^" in (await x /* runtimeCheckType= asy::Future<core::bool> */ ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} core::int;
return await x /* runtimeCheckType= asy::Future<core::bool> */ ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_4.dart:30:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ? 2 : new MyFuture<int>.value(3));
^" in (x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} FutureOr<core::int>){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => x ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t6 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_4.dart:33:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new MyFuture<int>.value(3);
^" in (x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} FutureOr<core::int>;
return x ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
}
static method main() → dynamic {}

View File

@ -1,23 +1,4 @@
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_then_conditional2_4.dart:24:9: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 2
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_4.dart:30:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ? 2 : new MyFuture<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_4.dart:33:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new MyFuture<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -45,21 +26,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(self::MyFuture<core::bool> f) → void {
self::MyFuture<core::int> t1 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ => x ?{core::int} 2 : await new self::MyFuture::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t2 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_4.dart:24:9: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 2
^" in (await x /* runtimeCheckType= asy::Future<core::bool> */ ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} core::int;
return await x /* runtimeCheckType= asy::Future<core::bool> */ ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_4.dart:30:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ? 2 : new MyFuture<int>.value(3));
^" in (x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} FutureOr<core::int>){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> => x ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
self::MyFuture<core::int> t6 = f.{self::MyFuture::then}<core::int>((core::bool x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_4.dart:33:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new MyFuture<int>.value(3);
^" in (x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} FutureOr<core::int>;
return x ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
}
static method main() → dynamic {}

View File

@ -1,23 +1,4 @@
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_then_conditional2_5.dart:24:9: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 2
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_5.dart:30:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ? 2 : new MyFuture<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_5.dart:33:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new MyFuture<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -45,21 +26,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(asy::Future<core::bool> f) → void {
asy::Future<core::int> t1 = f.{asy::Future::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ => x ?{core::int} 2 : await new self::MyFuture::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t2 = f.{asy::Future::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_5.dart:24:9: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 2
^" in (await x /* runtimeCheckType= asy::Future<core::bool> */ ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} core::int;
return await x /* runtimeCheckType= asy::Future<core::bool> */ ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t5 = f.{asy::Future::then}<core::int>((core::bool x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_5.dart:30:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ? 2 : new MyFuture<int>.value(3));
^" in (x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} FutureOr<core::int>){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t5 = f.{asy::Future::then}<core::int>((core::bool x) → FutureOr<core::int> => x ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t6 = f.{asy::Future::then}<core::int>((core::bool x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_5.dart:33:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new MyFuture<int>.value(3);
^" in (x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} FutureOr<core::int>;
return x ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
}
static method main() → dynamic {}

View File

@ -1,23 +1,4 @@
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_then_conditional2_5.dart:24:9: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 2
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_5.dart:30:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ? 2 : new MyFuture<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_5.dart:33:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new MyFuture<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -45,21 +26,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(asy::Future<core::bool> f) → void {
asy::Future<core::int> t1 = f.{asy::Future::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ => x ?{core::int} 2 : await new self::MyFuture::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t2 = f.{asy::Future::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_5.dart:24:9: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 2
^" in (await x /* runtimeCheckType= asy::Future<core::bool> */ ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} core::int;
return await x /* runtimeCheckType= asy::Future<core::bool> */ ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t5 = f.{asy::Future::then}<core::int>((core::bool x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_5.dart:30:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ? 2 : new MyFuture<int>.value(3));
^" in (x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} FutureOr<core::int>){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t5 = f.{asy::Future::then}<core::int>((core::bool x) → FutureOr<core::int> => x ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t6 = f.{asy::Future::then}<core::int>((core::bool x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_5.dart:33:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new MyFuture<int>.value(3);
^" in (x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} FutureOr<core::int>;
return x ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
}
static method main() → dynamic {}

View File

@ -1,23 +1,4 @@
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_then_conditional2_5.dart:24:9: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 2
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_5.dart:30:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ? 2 : new MyFuture<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_5.dart:33:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new MyFuture<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -45,21 +26,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(asy::Future<core::bool> f) → void {
asy::Future<core::int> t1 = f.{asy::Future::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ => x ?{core::int} 2 : await new self::MyFuture::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t2 = f.{asy::Future::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_5.dart:24:9: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 2
^" in (await x /* runtimeCheckType= asy::Future<core::bool> */ ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} core::int;
return await x /* runtimeCheckType= asy::Future<core::bool> */ ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t5 = f.{asy::Future::then}<core::int>((core::bool x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_5.dart:30:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ? 2 : new MyFuture<int>.value(3));
^" in (x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} FutureOr<core::int>){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t5 = f.{asy::Future::then}<core::int>((core::bool x) → FutureOr<core::int> => x ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t6 = f.{asy::Future::then}<core::int>((core::bool x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_5.dart:33:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new MyFuture<int>.value(3);
^" in (x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} FutureOr<core::int>;
return x ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
}
static method main() → dynamic {}

View File

@ -1,23 +1,4 @@
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_then_conditional2_5.dart:24:9: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 2
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_5.dart:30:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ? 2 : new MyFuture<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_5.dart:33:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new MyFuture<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -45,21 +26,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(asy::Future<core::bool> f) → void {
asy::Future<core::int> t1 = f.{asy::Future::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ => x ?{core::int} 2 : await new self::MyFuture::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t2 = f.{asy::Future::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_5.dart:24:9: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 2
^" in (await x /* runtimeCheckType= asy::Future<core::bool> */ ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} core::int;
return await x /* runtimeCheckType= asy::Future<core::bool> */ ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t5 = f.{asy::Future::then}<core::int>((core::bool x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_5.dart:30:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ? 2 : new MyFuture<int>.value(3));
^" in (x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} FutureOr<core::int>){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t5 = f.{asy::Future::then}<core::int>((core::bool x) → FutureOr<core::int> => x ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t6 = f.{asy::Future::then}<core::int>((core::bool x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_5.dart:33:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new MyFuture<int>.value(3);
^" in (x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} FutureOr<core::int>;
return x ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
}
static method main() → dynamic {}

View File

@ -1,23 +1,4 @@
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_then_conditional2_5.dart:24:9: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 2
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_5.dart:30:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ? 2 : new MyFuture<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_5.dart:33:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new MyFuture<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -45,21 +26,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(asy::Future<core::bool> f) → void {
asy::Future<core::int> t1 = f.{asy::Future::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ => x ?{core::int} 2 : await new self::MyFuture::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t2 = f.{asy::Future::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_5.dart:24:9: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 2
^" in (await x /* runtimeCheckType= asy::Future<core::bool> */ ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} core::int;
return await x /* runtimeCheckType= asy::Future<core::bool> */ ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t5 = f.{asy::Future::then}<core::int>((core::bool x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_5.dart:30:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ? 2 : new MyFuture<int>.value(3));
^" in (x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} FutureOr<core::int>){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t5 = f.{asy::Future::then}<core::int>((core::bool x) → FutureOr<core::int> => x ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t6 = f.{asy::Future::then}<core::int>((core::bool x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_5.dart:33:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new MyFuture<int>.value(3);
^" in (x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} FutureOr<core::int>;
return x ?{FutureOr<core::int>} 2 : new self::MyFuture::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
}
static method main() → dynamic {}

View File

@ -1,23 +1,4 @@
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_then_conditional2_6.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// return /*info:DOWN_CAST_COMPOSITE*/ await x ? 2 : new Future<int>.value(3);
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_6.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ? 2 : new Future<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_6.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new Future<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -45,21 +26,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(asy::Future<core::bool> f) → void {
asy::Future<core::int> t1 = f.{asy::Future::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ => x ?{core::int} 2 : await asy::Future::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t2 = f.{asy::Future::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_6.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
return /*info:DOWN_CAST_COMPOSITE*/ await x ? 2 : new Future<int>.value(3);
^" in (await x /* runtimeCheckType= asy::Future<core::bool> */ ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} core::int;
return await x /* runtimeCheckType= asy::Future<core::bool> */ ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t5 = f.{asy::Future::then}<core::int>((core::bool x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_6.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ? 2 : new Future<int>.value(3));
^" in (x ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} FutureOr<core::int>){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t5 = f.{asy::Future::then}<core::int>((core::bool x) → FutureOr<core::int> => x ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t6 = f.{asy::Future::then}<core::int>((core::bool x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_6.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new Future<int>.value(3);
^" in (x ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} FutureOr<core::int>;
return x ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
}
static method main() → dynamic {}

View File

@ -1,23 +1,4 @@
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_then_conditional2_6.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// return /*info:DOWN_CAST_COMPOSITE*/ await x ? 2 : new Future<int>.value(3);
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_6.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ? 2 : new Future<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_6.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new Future<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -45,21 +26,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(asy::Future<core::bool> f) → void {
asy::Future<core::int> t1 = f.{asy::Future::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ => x ?{core::int} 2 : await asy::Future::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t2 = f.{asy::Future::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_6.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
return /*info:DOWN_CAST_COMPOSITE*/ await x ? 2 : new Future<int>.value(3);
^" in (await x /* runtimeCheckType= asy::Future<core::bool> */ ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} core::int;
return await x /* runtimeCheckType= asy::Future<core::bool> */ ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t5 = f.{asy::Future::then}<core::int>((core::bool x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_6.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ? 2 : new Future<int>.value(3));
^" in (x ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} FutureOr<core::int>){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t5 = f.{asy::Future::then}<core::int>((core::bool x) → FutureOr<core::int> => x ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t6 = f.{asy::Future::then}<core::int>((core::bool x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_6.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new Future<int>.value(3);
^" in (x ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} FutureOr<core::int>;
return x ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
}
static method main() → dynamic {}

View File

@ -1,23 +1,4 @@
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_then_conditional2_6.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// return /*info:DOWN_CAST_COMPOSITE*/ await x ? 2 : new Future<int>.value(3);
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_6.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ? 2 : new Future<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_6.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new Future<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -45,21 +26,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(asy::Future<core::bool> f) → void {
asy::Future<core::int> t1 = f.{asy::Future::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ => x ?{core::int} 2 : await asy::Future::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t2 = f.{asy::Future::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_6.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
return /*info:DOWN_CAST_COMPOSITE*/ await x ? 2 : new Future<int>.value(3);
^" in (await x /* runtimeCheckType= asy::Future<core::bool> */ ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} core::int;
return await x /* runtimeCheckType= asy::Future<core::bool> */ ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t5 = f.{asy::Future::then}<core::int>((core::bool x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_6.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ? 2 : new Future<int>.value(3));
^" in (x ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} FutureOr<core::int>){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t5 = f.{asy::Future::then}<core::int>((core::bool x) → FutureOr<core::int> => x ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t6 = f.{asy::Future::then}<core::int>((core::bool x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_6.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new Future<int>.value(3);
^" in (x ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} FutureOr<core::int>;
return x ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
}
static method main() → dynamic {}

View File

@ -1,23 +1,4 @@
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_then_conditional2_6.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// return /*info:DOWN_CAST_COMPOSITE*/ await x ? 2 : new Future<int>.value(3);
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_6.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ? 2 : new Future<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_6.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new Future<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -45,21 +26,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(asy::Future<core::bool> f) → void {
asy::Future<core::int> t1 = f.{asy::Future::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ => x ?{core::int} 2 : await asy::Future::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t2 = f.{asy::Future::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_6.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
return /*info:DOWN_CAST_COMPOSITE*/ await x ? 2 : new Future<int>.value(3);
^" in (await x /* runtimeCheckType= asy::Future<core::bool> */ ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} core::int;
return await x /* runtimeCheckType= asy::Future<core::bool> */ ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t5 = f.{asy::Future::then}<core::int>((core::bool x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_6.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ? 2 : new Future<int>.value(3));
^" in (x ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} FutureOr<core::int>){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t5 = f.{asy::Future::then}<core::int>((core::bool x) → FutureOr<core::int> => x ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t6 = f.{asy::Future::then}<core::int>((core::bool x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_6.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new Future<int>.value(3);
^" in (x ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} FutureOr<core::int>;
return x ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
}
static method main() → dynamic {}

View File

@ -1,23 +1,4 @@
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_then_conditional2_6.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// return /*info:DOWN_CAST_COMPOSITE*/ await x ? 2 : new Future<int>.value(3);
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_6.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ? 2 : new Future<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_conditional2_6.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new Future<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -45,21 +26,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(asy::Future<core::bool> f) → void {
asy::Future<core::int> t1 = f.{asy::Future::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ => x ?{core::int} 2 : await asy::Future::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t2 = f.{asy::Future::then}<core::int>((core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_6.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
return /*info:DOWN_CAST_COMPOSITE*/ await x ? 2 : new Future<int>.value(3);
^" in (await x /* runtimeCheckType= asy::Future<core::bool> */ ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} core::int;
return await x /* runtimeCheckType= asy::Future<core::bool> */ ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t5 = f.{asy::Future::then}<core::int>((core::bool x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_6.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ? 2 : new Future<int>.value(3));
^" in (x ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} FutureOr<core::int>){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t5 = f.{asy::Future::then}<core::int>((core::bool x) → FutureOr<core::int> => x ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3)){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
asy::Future<core::int> t6 = f.{asy::Future::then}<core::int>((core::bool x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_conditional2_6.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new Future<int>.value(3);
^" in (x ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} FutureOr<core::int>;
return x ?{FutureOr<core::int>} 2 : asy::Future::value<core::int>(3);
}){((core::bool) → FutureOr<core::int>, {onError: core::Function?}) → asy::Future<core::int>};
}
static method main() → dynamic {}

View File

@ -10,30 +10,14 @@ library test;
// return /*info:DOWN_CAST_COMPOSITE*/ await x ?? new Future<int>.value(3);
// ^
//
// pkg/front_end/testcases/inference/future_then_ifNull2.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// return /*info:DOWN_CAST_COMPOSITE*/ await x ?? new Future<int>.value(3);
// ^
//
// pkg/front_end/testcases/inference/future_then_ifNull2.dart:28:11: Warning: Operand of null-aware operation '??' has type 'int' which excludes null.
// x ?? new Future<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_ifNull2.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ?? new Future<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_ifNull2.dart:31:41: Warning: Operand of null-aware operation '??' has type 'int' which excludes null.
// return /*info:DOWN_CAST_COMPOSITE*/ x ?? new Future<int>.value(3);
// ^
//
// pkg/front_end/testcases/inference/future_then_ifNull2.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ?? new Future<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -61,21 +45,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(self::MyFuture<core::int> f) → void {
asy::Future<core::int> t1 = f.{self::MyFuture::then}<core::int>((core::int x) → asy::Future<core::int> async /* emittedValueType= core::int */ => let final core::int #t1 = x in #t1 == null ?{core::int} await asy::Future::value<core::int>(3) : #t1){((core::int) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t2 = f.{self::MyFuture::then}<core::int>((core::int x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_ifNull2.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
return /*info:DOWN_CAST_COMPOSITE*/ await x ?? new Future<int>.value(3);
^" in (let final core::int #t2 = await x /* runtimeCheckType= asy::Future<core::int> */ in #t2 == null ?{core::Object} asy::Future::value<core::int>(3) : #t2) as{TypeError} core::int;
return let final core::int #t2 = await x /* runtimeCheckType= asy::Future<core::int> */ in #t2 == null ?{FutureOr<core::int>} asy::Future::value<core::int>(3) : #t2;
}){((core::int) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::int x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_ifNull2.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ?? new Future<int>.value(3));
^" in (let final core::int #t3 = x in #t3 == null ?{core::Object} asy::Future::value<core::int>(3) : #t3) as{TypeError} FutureOr<core::int>){((core::int) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::int x) → FutureOr<core::int> => let final core::int #t3 = x in #t3 == null ?{FutureOr<core::int>} asy::Future::value<core::int>(3) : #t3){((core::int) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t6 = f.{self::MyFuture::then}<core::int>((core::int x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_ifNull2.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ?? new Future<int>.value(3);
^" in (let final core::int #t4 = x in #t4 == null ?{core::Object} asy::Future::value<core::int>(3) : #t4) as{TypeError} FutureOr<core::int>;
return let final core::int #t4 = x in #t4 == null ?{FutureOr<core::int>} asy::Future::value<core::int>(3) : #t4;
}){((core::int) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
}
static method main() → dynamic {}

View File

@ -10,30 +10,14 @@ library test;
// return /*info:DOWN_CAST_COMPOSITE*/ await x ?? new Future<int>.value(3);
// ^
//
// pkg/front_end/testcases/inference/future_then_ifNull2.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// return /*info:DOWN_CAST_COMPOSITE*/ await x ?? new Future<int>.value(3);
// ^
//
// pkg/front_end/testcases/inference/future_then_ifNull2.dart:28:11: Warning: Operand of null-aware operation '??' has type 'int' which excludes null.
// x ?? new Future<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_ifNull2.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ?? new Future<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_ifNull2.dart:31:41: Warning: Operand of null-aware operation '??' has type 'int' which excludes null.
// return /*info:DOWN_CAST_COMPOSITE*/ x ?? new Future<int>.value(3);
// ^
//
// pkg/front_end/testcases/inference/future_then_ifNull2.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ?? new Future<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -61,21 +45,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(self::MyFuture<core::int> f) → void {
asy::Future<core::int> t1 = f.{self::MyFuture::then}<core::int>((core::int x) → asy::Future<core::int> async /* emittedValueType= core::int */ => let final core::int #t1 = x in #t1 == null ?{core::int} await asy::Future::value<core::int>(3) : #t1){((core::int) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t2 = f.{self::MyFuture::then}<core::int>((core::int x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_ifNull2.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
return /*info:DOWN_CAST_COMPOSITE*/ await x ?? new Future<int>.value(3);
^" in (let final core::int #t2 = await x /* runtimeCheckType= asy::Future<core::int> */ in #t2 == null ?{core::Object} asy::Future::value<core::int>(3) : #t2) as{TypeError} core::int;
return let final core::int #t2 = await x /* runtimeCheckType= asy::Future<core::int> */ in #t2 == null ?{FutureOr<core::int>} asy::Future::value<core::int>(3) : #t2;
}){((core::int) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::int x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_ifNull2.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ?? new Future<int>.value(3));
^" in (let final core::int #t3 = x in #t3 == null ?{core::Object} asy::Future::value<core::int>(3) : #t3) as{TypeError} FutureOr<core::int>){((core::int) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::int x) → FutureOr<core::int> => let final core::int #t3 = x in #t3 == null ?{FutureOr<core::int>} asy::Future::value<core::int>(3) : #t3){((core::int) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t6 = f.{self::MyFuture::then}<core::int>((core::int x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_ifNull2.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ?? new Future<int>.value(3);
^" in (let final core::int #t4 = x in #t4 == null ?{core::Object} asy::Future::value<core::int>(3) : #t4) as{TypeError} FutureOr<core::int>;
return let final core::int #t4 = x in #t4 == null ?{FutureOr<core::int>} asy::Future::value<core::int>(3) : #t4;
}){((core::int) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
}
static method main() → dynamic {}

View File

@ -10,30 +10,14 @@ library test;
// return /*info:DOWN_CAST_COMPOSITE*/ await x ?? new Future<int>.value(3);
// ^
//
// pkg/front_end/testcases/inference/future_then_ifNull2.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// return /*info:DOWN_CAST_COMPOSITE*/ await x ?? new Future<int>.value(3);
// ^
//
// pkg/front_end/testcases/inference/future_then_ifNull2.dart:28:11: Warning: Operand of null-aware operation '??' has type 'int' which excludes null.
// x ?? new Future<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_ifNull2.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ?? new Future<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_ifNull2.dart:31:41: Warning: Operand of null-aware operation '??' has type 'int' which excludes null.
// return /*info:DOWN_CAST_COMPOSITE*/ x ?? new Future<int>.value(3);
// ^
//
// pkg/front_end/testcases/inference/future_then_ifNull2.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ?? new Future<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -61,21 +45,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(self::MyFuture<core::int> f) → void {
asy::Future<core::int> t1 = f.{self::MyFuture::then}<core::int>((core::int x) → asy::Future<core::int> async /* emittedValueType= core::int */ => let final core::int #t1 = x in #t1 == null ?{core::int} await asy::Future::value<core::int>(3) : #t1){((core::int) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t2 = f.{self::MyFuture::then}<core::int>((core::int x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_ifNull2.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
return /*info:DOWN_CAST_COMPOSITE*/ await x ?? new Future<int>.value(3);
^" in (let final core::int #t2 = await x /* runtimeCheckType= asy::Future<core::int> */ in #t2 == null ?{core::Object} asy::Future::value<core::int>(3) : #t2) as{TypeError} core::int;
return let final core::int #t2 = await x /* runtimeCheckType= asy::Future<core::int> */ in #t2 == null ?{FutureOr<core::int>} asy::Future::value<core::int>(3) : #t2;
}){((core::int) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::int x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_ifNull2.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ?? new Future<int>.value(3));
^" in (let final core::int #t3 = x in #t3 == null ?{core::Object} asy::Future::value<core::int>(3) : #t3) as{TypeError} FutureOr<core::int>){((core::int) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::int x) → FutureOr<core::int> => let final core::int #t3 = x in #t3 == null ?{FutureOr<core::int>} asy::Future::value<core::int>(3) : #t3){((core::int) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t6 = f.{self::MyFuture::then}<core::int>((core::int x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_ifNull2.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ?? new Future<int>.value(3);
^" in (let final core::int #t4 = x in #t4 == null ?{core::Object} asy::Future::value<core::int>(3) : #t4) as{TypeError} FutureOr<core::int>;
return let final core::int #t4 = x in #t4 == null ?{FutureOr<core::int>} asy::Future::value<core::int>(3) : #t4;
}){((core::int) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
}
static method main() → dynamic {}

View File

@ -10,30 +10,14 @@ library test;
// return /*info:DOWN_CAST_COMPOSITE*/ await x ?? new Future<int>.value(3);
// ^
//
// pkg/front_end/testcases/inference/future_then_ifNull2.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// return /*info:DOWN_CAST_COMPOSITE*/ await x ?? new Future<int>.value(3);
// ^
//
// pkg/front_end/testcases/inference/future_then_ifNull2.dart:28:11: Warning: Operand of null-aware operation '??' has type 'int' which excludes null.
// x ?? new Future<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_ifNull2.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ?? new Future<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_ifNull2.dart:31:41: Warning: Operand of null-aware operation '??' has type 'int' which excludes null.
// return /*info:DOWN_CAST_COMPOSITE*/ x ?? new Future<int>.value(3);
// ^
//
// pkg/front_end/testcases/inference/future_then_ifNull2.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ?? new Future<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -61,21 +45,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(self::MyFuture<core::int> f) → void {
asy::Future<core::int> t1 = f.{self::MyFuture::then}<core::int>((core::int x) → asy::Future<core::int> async /* emittedValueType= core::int */ => let final core::int #t1 = x in #t1 == null ?{core::int} await asy::Future::value<core::int>(3) : #t1){((core::int) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t2 = f.{self::MyFuture::then}<core::int>((core::int x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_ifNull2.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
return /*info:DOWN_CAST_COMPOSITE*/ await x ?? new Future<int>.value(3);
^" in (let final core::int #t2 = await x /* runtimeCheckType= asy::Future<core::int> */ in #t2 == null ?{core::Object} asy::Future::value<core::int>(3) : #t2) as{TypeError} core::int;
return let final core::int #t2 = await x /* runtimeCheckType= asy::Future<core::int> */ in #t2 == null ?{FutureOr<core::int>} asy::Future::value<core::int>(3) : #t2;
}){((core::int) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::int x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_ifNull2.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ?? new Future<int>.value(3));
^" in (let final core::int #t3 = x in #t3 == null ?{core::Object} asy::Future::value<core::int>(3) : #t3) as{TypeError} FutureOr<core::int>){((core::int) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::int x) → FutureOr<core::int> => let final core::int #t3 = x in #t3 == null ?{FutureOr<core::int>} asy::Future::value<core::int>(3) : #t3){((core::int) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t6 = f.{self::MyFuture::then}<core::int>((core::int x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_ifNull2.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ?? new Future<int>.value(3);
^" in (let final core::int #t4 = x in #t4 == null ?{core::Object} asy::Future::value<core::int>(3) : #t4) as{TypeError} FutureOr<core::int>;
return let final core::int #t4 = x in #t4 == null ?{FutureOr<core::int>} asy::Future::value<core::int>(3) : #t4;
}){((core::int) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
}
static method main() → dynamic {}

View File

@ -10,30 +10,14 @@ library test;
// return /*info:DOWN_CAST_COMPOSITE*/ await x ?? new Future<int>.value(3);
// ^
//
// pkg/front_end/testcases/inference/future_then_ifNull2.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// return /*info:DOWN_CAST_COMPOSITE*/ await x ?? new Future<int>.value(3);
// ^
//
// pkg/front_end/testcases/inference/future_then_ifNull2.dart:28:11: Warning: Operand of null-aware operation '??' has type 'int' which excludes null.
// x ?? new Future<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_ifNull2.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// x ?? new Future<int>.value(3));
// ^
//
// pkg/front_end/testcases/inference/future_then_ifNull2.dart:31:41: Warning: Operand of null-aware operation '??' has type 'int' which excludes null.
// return /*info:DOWN_CAST_COMPOSITE*/ x ?? new Future<int>.value(3);
// ^
//
// pkg/front_end/testcases/inference/future_then_ifNull2.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
// - 'Object' is from 'dart:core'.
// return /*info:DOWN_CAST_COMPOSITE*/ x ?? new Future<int>.value(3);
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
@ -61,21 +45,11 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
static method test(self::MyFuture<core::int> f) → void {
asy::Future<core::int> t1 = f.{self::MyFuture::then}<core::int>((core::int x) → asy::Future<core::int> async /* emittedValueType= core::int */ => let final core::int #t1 = x in #t1 == null ?{core::int} await asy::Future::value<core::int>(3) : #t1){((core::int) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t2 = f.{self::MyFuture::then}<core::int>((core::int x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_then_ifNull2.dart:23:49: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
return /*info:DOWN_CAST_COMPOSITE*/ await x ?? new Future<int>.value(3);
^" in (let final core::int #t2 = await x /* runtimeCheckType= asy::Future<core::int> */ in #t2 == null ?{core::Object} asy::Future::value<core::int>(3) : #t2) as{TypeError} core::int;
return let final core::int #t2 = await x /* runtimeCheckType= asy::Future<core::int> */ in #t2 == null ?{FutureOr<core::int>} asy::Future::value<core::int>(3) : #t2;
}){((core::int) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::int x) → FutureOr<core::int> => invalid-expression "pkg/front_end/testcases/inference/future_then_ifNull2.dart:28:13: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
x ?? new Future<int>.value(3));
^" in (let final core::int #t3 = x in #t3 == null ?{core::Object} asy::Future::value<core::int>(3) : #t3) as{TypeError} FutureOr<core::int>){((core::int) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::int x) → FutureOr<core::int> => let final core::int #t3 = x in #t3 == null ?{FutureOr<core::int>} asy::Future::value<core::int>(3) : #t3){((core::int) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
asy::Future<core::int> t6 = f.{self::MyFuture::then}<core::int>((core::int x) → FutureOr<core::int> {
return invalid-expression "pkg/front_end/testcases/inference/future_then_ifNull2.dart:31:43: Error: A value of type 'Object' can't be returned from a function with return type 'FutureOr<int>'.
- 'Object' is from 'dart:core'.
return /*info:DOWN_CAST_COMPOSITE*/ x ?? new Future<int>.value(3);
^" in (let final core::int #t4 = x in #t4 == null ?{core::Object} asy::Future::value<core::int>(3) : #t4) as{TypeError} FutureOr<core::int>;
return let final core::int #t4 = x in #t4 == null ?{FutureOr<core::int>} asy::Future::value<core::int>(3) : #t4;
}){((core::int) → FutureOr<core::int>, {onError: core::Function?}) → self::MyFuture<core::int>};
}
static method main() → dynamic {}

View File

@ -2,18 +2,6 @@ library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_union_async_conditional2.dart:19:7: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 42
// ^
//
// pkg/front_end/testcases/inference/future_union_async_conditional2.dart:24:5: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 42
// ^
//
// pkg/front_end/testcases/inference/future_union_async_conditional2.dart:28:39: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
@ -45,18 +33,10 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))){(core::Invocation) → dynamic} as{TypeError,ForDynamic} asy::Future<self::MyFuture::T%>;
}
static method g1(core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_union_async_conditional2.dart:19:7: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 42
^" in (x ?{core::Object} 42 : asy::Future::value<core::int>(42)) as{TypeError} core::int;
return x ?{FutureOr<core::int>} 42 : asy::Future::value<core::int>(42);
}
static method g2(core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */
return invalid-expression "pkg/front_end/testcases/inference/future_union_async_conditional2.dart:24:5: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 42
^" in (x ?{core::Object} 42 : asy::Future::value<core::int>(42)) as{TypeError} core::int;
return x ?{FutureOr<core::int>} 42 : asy::Future::value<core::int>(42);
static method g3(core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
core::Object y = x ?{core::Object} 42 : asy::Future::value<core::int>(42);
return invalid-expression "pkg/front_end/testcases/inference/future_union_async_conditional2.dart:28:39: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.

View File

@ -2,18 +2,6 @@ library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_union_async_conditional2.dart:19:7: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 42
// ^
//
// pkg/front_end/testcases/inference/future_union_async_conditional2.dart:24:5: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 42
// ^
//
// pkg/front_end/testcases/inference/future_union_async_conditional2.dart:28:39: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
@ -45,18 +33,10 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(core::_GrowableList::_literal1<dynamic>(timeLimit)), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))){(core::Invocation) → dynamic} as{TypeError,ForDynamic} asy::Future<self::MyFuture::T%>;
}
static method g1(core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_union_async_conditional2.dart:19:7: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 42
^" in (x ?{core::Object} 42 : asy::Future::value<core::int>(42)) as{TypeError} core::int;
return x ?{FutureOr<core::int>} 42 : asy::Future::value<core::int>(42);
}
static method g2(core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */
return invalid-expression "pkg/front_end/testcases/inference/future_union_async_conditional2.dart:24:5: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 42
^" in (x ?{core::Object} 42 : asy::Future::value<core::int>(42)) as{TypeError} core::int;
return x ?{FutureOr<core::int>} 42 : asy::Future::value<core::int>(42);
static method g3(core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
core::Object y = x ?{core::Object} 42 : asy::Future::value<core::int>(42);
return invalid-expression "pkg/front_end/testcases/inference/future_union_async_conditional2.dart:28:39: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.

View File

@ -2,18 +2,6 @@ library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_union_async_conditional2.dart:19:7: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 42
// ^
//
// pkg/front_end/testcases/inference/future_union_async_conditional2.dart:24:5: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 42
// ^
//
// pkg/front_end/testcases/inference/future_union_async_conditional2.dart:28:39: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
@ -45,18 +33,10 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))){(core::Invocation) → dynamic} as{TypeError,ForDynamic} asy::Future<self::MyFuture::T%>;
}
static method g1(core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_union_async_conditional2.dart:19:7: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 42
^" in (x ?{core::Object} 42 : asy::Future::value<core::int>(42)) as{TypeError} core::int;
return x ?{FutureOr<core::int>} 42 : asy::Future::value<core::int>(42);
}
static method g2(core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */
return invalid-expression "pkg/front_end/testcases/inference/future_union_async_conditional2.dart:24:5: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 42
^" in (x ?{core::Object} 42 : asy::Future::value<core::int>(42)) as{TypeError} core::int;
return x ?{FutureOr<core::int>} 42 : asy::Future::value<core::int>(42);
static method g3(core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
core::Object y = x ?{core::Object} 42 : asy::Future::value<core::int>(42);
return invalid-expression "pkg/front_end/testcases/inference/future_union_async_conditional2.dart:28:39: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.

View File

@ -2,18 +2,6 @@ library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_union_async_conditional2.dart:19:7: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 42
// ^
//
// pkg/front_end/testcases/inference/future_union_async_conditional2.dart:24:5: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 42
// ^
//
// pkg/front_end/testcases/inference/future_union_async_conditional2.dart:28:39: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
@ -45,18 +33,10 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))){(core::Invocation) → dynamic} as{TypeError,ForDynamic} asy::Future<self::MyFuture::T%>;
}
static method g1(core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_union_async_conditional2.dart:19:7: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 42
^" in (x ?{core::Object} 42 : asy::Future::value<core::int>(42)) as{TypeError} core::int;
return x ?{FutureOr<core::int>} 42 : asy::Future::value<core::int>(42);
}
static method g2(core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */
return invalid-expression "pkg/front_end/testcases/inference/future_union_async_conditional2.dart:24:5: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 42
^" in (x ?{core::Object} 42 : asy::Future::value<core::int>(42)) as{TypeError} core::int;
return x ?{FutureOr<core::int>} 42 : asy::Future::value<core::int>(42);
static method g3(core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
core::Object y = x ?{core::Object} 42 : asy::Future::value<core::int>(42);
return invalid-expression "pkg/front_end/testcases/inference/future_union_async_conditional2.dart:28:39: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.

View File

@ -2,18 +2,6 @@ library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_union_async_conditional2.dart:19:7: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 42
// ^
//
// pkg/front_end/testcases/inference/future_union_async_conditional2.dart:24:5: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 42
// ^
//
// pkg/front_end/testcases/inference/future_union_async_conditional2.dart:28:39: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
@ -45,18 +33,10 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(core::_GrowableList::_literal1<dynamic>(timeLimit)), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))){(core::Invocation) → dynamic} as{TypeError,ForDynamic} asy::Future<self::MyFuture::T%>;
}
static method g1(core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_union_async_conditional2.dart:19:7: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 42
^" in (x ?{core::Object} 42 : asy::Future::value<core::int>(42)) as{TypeError} core::int;
return x ?{FutureOr<core::int>} 42 : asy::Future::value<core::int>(42);
}
static method g2(core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */
return invalid-expression "pkg/front_end/testcases/inference/future_union_async_conditional2.dart:24:5: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 42
^" in (x ?{core::Object} 42 : asy::Future::value<core::int>(42)) as{TypeError} core::int;
return x ?{FutureOr<core::int>} 42 : asy::Future::value<core::int>(42);
static method g3(core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
core::Object y = x ?{core::Object} 42 : asy::Future::value<core::int>(42);
return invalid-expression "pkg/front_end/testcases/inference/future_union_async_conditional2.dart:28:39: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.

View File

@ -2,18 +2,6 @@ library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_union_async_conditional_2_2.dart:19:7: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 42
// ^
//
// pkg/front_end/testcases/inference/future_union_async_conditional_2_2.dart:24:5: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 42
// ^
//
// pkg/front_end/testcases/inference/future_union_async_conditional_2_2.dart:29:39: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
@ -45,18 +33,10 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))){(core::Invocation) → dynamic} as{TypeError,ForDynamic} asy::Future<self::MyFuture::T%>;
}
static method g1(core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_union_async_conditional_2_2.dart:19:7: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 42
^" in (x ?{core::Object} 42 : new self::MyFuture::value<core::int>(42)) as{TypeError} core::int;
return x ?{FutureOr<core::int>} 42 : new self::MyFuture::value<core::int>(42);
}
static method g2(core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */
return invalid-expression "pkg/front_end/testcases/inference/future_union_async_conditional_2_2.dart:24:5: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 42
^" in (x ?{core::Object} 42 : new self::MyFuture::value<core::int>(42)) as{TypeError} core::int;
return x ?{FutureOr<core::int>} 42 : new self::MyFuture::value<core::int>(42);
static method g3(core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
core::Object y = x ?{core::Object} 42 : new self::MyFuture::value<dynamic>(42);
return invalid-expression "pkg/front_end/testcases/inference/future_union_async_conditional_2_2.dart:29:39: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.

View File

@ -2,18 +2,6 @@ library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_union_async_conditional_2_2.dart:19:7: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 42
// ^
//
// pkg/front_end/testcases/inference/future_union_async_conditional_2_2.dart:24:5: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 42
// ^
//
// pkg/front_end/testcases/inference/future_union_async_conditional_2_2.dart:29:39: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
@ -45,18 +33,10 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(core::_GrowableList::_literal1<dynamic>(timeLimit)), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))){(core::Invocation) → dynamic} as{TypeError,ForDynamic} asy::Future<self::MyFuture::T%>;
}
static method g1(core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_union_async_conditional_2_2.dart:19:7: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 42
^" in (x ?{core::Object} 42 : new self::MyFuture::value<core::int>(42)) as{TypeError} core::int;
return x ?{FutureOr<core::int>} 42 : new self::MyFuture::value<core::int>(42);
}
static method g2(core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */
return invalid-expression "pkg/front_end/testcases/inference/future_union_async_conditional_2_2.dart:24:5: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 42
^" in (x ?{core::Object} 42 : new self::MyFuture::value<core::int>(42)) as{TypeError} core::int;
return x ?{FutureOr<core::int>} 42 : new self::MyFuture::value<core::int>(42);
static method g3(core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
core::Object y = x ?{core::Object} 42 : new self::MyFuture::value<dynamic>(42);
return invalid-expression "pkg/front_end/testcases/inference/future_union_async_conditional_2_2.dart:29:39: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.

View File

@ -2,18 +2,6 @@ library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_union_async_conditional_2_2.dart:19:7: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 42
// ^
//
// pkg/front_end/testcases/inference/future_union_async_conditional_2_2.dart:24:5: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 42
// ^
//
// pkg/front_end/testcases/inference/future_union_async_conditional_2_2.dart:29:39: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
@ -45,18 +33,10 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))){(core::Invocation) → dynamic} as{TypeError,ForDynamic} asy::Future<self::MyFuture::T%>;
}
static method g1(core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_union_async_conditional_2_2.dart:19:7: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 42
^" in (x ?{core::Object} 42 : new self::MyFuture::value<core::int>(42)) as{TypeError} core::int;
return x ?{FutureOr<core::int>} 42 : new self::MyFuture::value<core::int>(42);
}
static method g2(core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */
return invalid-expression "pkg/front_end/testcases/inference/future_union_async_conditional_2_2.dart:24:5: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 42
^" in (x ?{core::Object} 42 : new self::MyFuture::value<core::int>(42)) as{TypeError} core::int;
return x ?{FutureOr<core::int>} 42 : new self::MyFuture::value<core::int>(42);
static method g3(core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
core::Object y = x ?{core::Object} 42 : new self::MyFuture::value<dynamic>(42);
return invalid-expression "pkg/front_end/testcases/inference/future_union_async_conditional_2_2.dart:29:39: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.

View File

@ -2,18 +2,6 @@ library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_union_async_conditional_2_2.dart:19:7: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 42
// ^
//
// pkg/front_end/testcases/inference/future_union_async_conditional_2_2.dart:24:5: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 42
// ^
//
// pkg/front_end/testcases/inference/future_union_async_conditional_2_2.dart:29:39: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
@ -45,18 +33,10 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))){(core::Invocation) → dynamic} as{TypeError,ForDynamic} asy::Future<self::MyFuture::T%>;
}
static method g1(core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_union_async_conditional_2_2.dart:19:7: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 42
^" in (x ?{core::Object} 42 : new self::MyFuture::value<core::int>(42)) as{TypeError} core::int;
return x ?{FutureOr<core::int>} 42 : new self::MyFuture::value<core::int>(42);
}
static method g2(core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */
return invalid-expression "pkg/front_end/testcases/inference/future_union_async_conditional_2_2.dart:24:5: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 42
^" in (x ?{core::Object} 42 : new self::MyFuture::value<core::int>(42)) as{TypeError} core::int;
return x ?{FutureOr<core::int>} 42 : new self::MyFuture::value<core::int>(42);
static method g3(core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
core::Object y = x ?{core::Object} 42 : new self::MyFuture::value<dynamic>(42);
return invalid-expression "pkg/front_end/testcases/inference/future_union_async_conditional_2_2.dart:29:39: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.

View File

@ -2,18 +2,6 @@ library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_union_async_conditional_2_2.dart:19:7: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 42
// ^
//
// pkg/front_end/testcases/inference/future_union_async_conditional_2_2.dart:24:5: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// ? 42
// ^
//
// pkg/front_end/testcases/inference/future_union_async_conditional_2_2.dart:29:39: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
// - 'Object' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
@ -45,18 +33,10 @@ class MyFuture<T extends core::Object? = dynamic> extends core::Object implement
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(core::_GrowableList::_literal1<dynamic>(timeLimit)), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))){(core::Invocation) → dynamic} as{TypeError,ForDynamic} asy::Future<self::MyFuture::T%>;
}
static method g1(core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
return invalid-expression "pkg/front_end/testcases/inference/future_union_async_conditional_2_2.dart:19:7: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 42
^" in (x ?{core::Object} 42 : new self::MyFuture::value<core::int>(42)) as{TypeError} core::int;
return x ?{FutureOr<core::int>} 42 : new self::MyFuture::value<core::int>(42);
}
static method g2(core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */
return invalid-expression "pkg/front_end/testcases/inference/future_union_async_conditional_2_2.dart:24:5: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
? 42
^" in (x ?{core::Object} 42 : new self::MyFuture::value<core::int>(42)) as{TypeError} core::int;
return x ?{FutureOr<core::int>} 42 : new self::MyFuture::value<core::int>(42);
static method g3(core::bool x) → asy::Future<core::int> async /* emittedValueType= core::int */ {
core::Object y = x ?{core::Object} 42 : new self::MyFuture::value<dynamic>(42);
return invalid-expression "pkg/front_end/testcases/inference/future_union_async_conditional_2_2.dart:29:39: Error: A value of type 'Object' can't be returned from an async function with return type 'Future<int>'.

View File

@ -17,7 +17,7 @@ namespace dart {
bool GetExperimentalFeatureDefault(ExperimentalFeature feature) {
constexpr bool kFeatureValues[] = {
true, true, true, true, true, true, true, true, true, true, true,
true, true, true, true, true, true, true, true, true, true,
true, true, true, true, true, true, true, true, true, true, true,
};
ASSERT(static_cast<size_t>(feature) < ARRAY_SIZE(kFeatureValues));
return kFeatureValues[static_cast<int>(feature)];
@ -25,6 +25,7 @@ bool GetExperimentalFeatureDefault(ExperimentalFeature feature) {
const char* GetExperimentalFeatureName(ExperimentalFeature feature) {
constexpr const char* kFeatureNames[] = {
"inference-update-3",
"inline-class",
"inference-update-2",
"sealed-class",

View File

@ -12,6 +12,7 @@
namespace dart {
enum class ExperimentalFeature {
inference_update_3,
inline_class,
inference_update_2,
sealed_class,

View File

@ -128,9 +128,6 @@ features:
resource-identifiers:
help: "Output arguments used by static functions."
inference-update-3: # See https://github.com/dart-lang/language/issues/1618
help: "Better handling of conditional expressions, and switch expressions."
# Experiment flag only used for testing.
test-experiment:
help: >-
@ -144,6 +141,20 @@ features:
# Shipped flags should be marked retired the following stable release.
#
inference-update-3: # See https://github.com/dart-lang/language/issues/1618
enabledIn: '3.4.0'
validation: |
class A {}
class B1 implements A {}
class B2 implements A {}
class C1 implements B1, B2 {}
class C2 implements B1, B2 {}
B1 test(bool b, C1 c1, C2 c2) => b ? c1 : c2;
main() {
print('feature enabled');
}
help: "Better handling of conditional expressions, and switch expressions."
inline-class:
enabledIn: '3.3.0'
validation: |