From fd432febe05136d18a94fc0bb069bcd5ff0dcf67 Mon Sep 17 00:00:00 2001 From: Johnni Winther Date: Wed, 8 Jul 2020 14:47:14 +0000 Subject: [PATCH] [cfe] Update messages for invalid returns Closes #42527 Change-Id: Ic240dd7a8822c85c550941923bf9ce3b5cfe0dba Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153348 Commit-Queue: Johnni Winther Reviewed-by: Erik Ernst --- .../src/fasta/fasta_codes_cfe_generated.dart | 78 +++++++++++++++++++ .../fasta/type_inference/closure_context.dart | 32 +++----- .../fasta/type_inference/type_inferrer.dart | 25 ++++-- pkg/front_end/messages.status | 2 + pkg/front_end/messages.yaml | 10 +++ ...ic_object_call.dart.textual_outline.expect | 9 +++ ..._call.dart.textual_outline_modelled.expect | 9 +++ .../issue41386.dart.textual_outline.expect | 3 + ...41386.dart.textual_outline_modelled.expect | 3 + .../issue41386b.dart.textual_outline.expect | 2 + ...1386b.dart.textual_outline_modelled.expect | 2 + .../nnbd/issue41437a.dart.strong.expect | 8 +- ...issue41437a.dart.strong.transformed.expect | 8 +- .../nnbd/issue41437a.dart.weak.expect | 8 +- .../issue41437a.dart.weak.transformed.expect | 8 +- .../nnbd/issue41437b.dart.strong.expect | 8 +- ...issue41437b.dart.strong.transformed.expect | 8 +- .../issue41437b.dart.textual_outline.expect | 12 +++ ...1437b.dart.textual_outline_modelled.expect | 12 +++ .../nnbd/issue41437b.dart.weak.expect | 8 +- .../issue41437b.dart.weak.transformed.expect | 8 +- .../nnbd/issue41437c.dart.strong.expect | 8 +- ...issue41437c.dart.strong.transformed.expect | 8 +- .../issue41437c.dart.textual_outline.expect | 12 +++ ...1437c.dart.textual_outline_modelled.expect | 12 +++ .../nnbd/issue41437c.dart.weak.expect | 8 +- .../issue41437c.dart.weak.transformed.expect | 8 +- .../issue41520.dart.textual_outline.expect | 4 + ...41520.dart.textual_outline_modelled.expect | 4 + .../issue41700a.dart.textual_outline.expect | 2 + ...1700a.dart.textual_outline_modelled.expect | 2 + .../issue41700b.dart.textual_outline.expect | 4 + ...1700b.dart.textual_outline_modelled.expect | 4 + .../never_calls.dart.textual_outline.expect | 6 ++ ...calls.dart.textual_outline_modelled.expect | 6 ++ .../never_equals.dart.textual_outline.expect | 2 + ...quals.dart.textual_outline_modelled.expect | 2 + ...ant_type_casts.dart.textual_outline.expect | 6 ++ ...casts.dart.textual_outline_modelled.expect | 6 ++ .../nnbd/return_null.dart.strong.expect | 16 ++-- ...return_null.dart.strong.transformed.expect | 16 ++-- .../nnbd/return_null.dart.weak.expect | 16 ++-- .../return_null.dart.weak.transformed.expect | 16 ++-- ...d_lower_bounds.dart.textual_outline.expect | 7 ++ ...ounds.dart.textual_outline_modelled.expect | 8 ++ .../nnbd_mixed/never_opt_out.dart.weak.expect | 4 +- .../factory/return_type_checked_test.dart | 2 +- .../function_literal_arrow_test.dart | 2 +- .../function_literal_return_test.dart | 2 +- .../return_async_test.dart | 4 +- .../implicit_downcast_during/return_test.dart | 4 +- .../async_invalid_return_00_test.dart | 4 +- .../async_invalid_return_01_test.dart | 4 +- .../async_invalid_return_02_test.dart | 4 +- .../async_invalid_return_03_test.dart | 2 +- .../async_invalid_return_04_test.dart | 2 +- .../async_invalid_return_05_test.dart | 2 +- .../async_invalid_return_08_test.dart | 2 +- .../async_invalid_return_11_test.dart | 2 +- .../async_invalid_return_14_test.dart | 2 +- .../async_invalid_return_17_test.dart | 2 +- .../async_invalid_return_20_test.dart | 2 +- .../async_invalid_return_23_test.dart | 4 +- .../async_invalid_return_24_test.dart | 4 +- .../async_invalid_return_25_test.dart | 4 +- .../async_invalid_return_26_test.dart | 2 +- .../async_invalid_return_27_test.dart | 2 +- .../async_invalid_return_28_test.dart | 2 +- .../async_invalid_return_29_test.dart | 2 +- .../async_invalid_return_30_test.dart | 2 +- .../async_invalid_return_31_test.dart | 2 +- .../async_invalid_return_32_test.dart | 2 +- .../async_invalid_return_33_test.dart | 2 +- .../async_invalid_return_34_test.dart | 2 +- .../async_invalid_return_35_test.dart | 2 +- .../async_invalid_return_36_test.dart | 6 +- .../async_invalid_return_37_test.dart | 2 +- .../async_invalid_return_38_test.dart | 4 +- .../async_invalid_return_39_test.dart | 4 +- .../async_invalid_return_40_test.dart | 4 +- .../async_invalid_return_41_test.dart | 4 +- .../async_invalid_return_42_test.dart | 4 +- .../async_invalid_return_43_test.dart | 4 +- .../async_invalid_return_44_test.dart | 4 +- .../async_invalid_return_45_test.dart | 4 +- .../async_invalid_return_47_test.dart | 4 +- .../async_invalid_return_48_test.dart | 4 +- .../async_invalid_return_50_test.dart | 4 +- .../async_invalid_return_51_test.dart | 4 +- .../async_invalid_return_52_test.dart | 2 +- .../async_invalid_return_53_test.dart | 2 +- .../async_invalid_return_54_test.dart | 2 +- .../async_invalid_return_55_test.dart | 2 +- .../async_invalid_return_56_test.dart | 2 +- .../async_invalid_return_57_test.dart | 2 +- .../async_invalid_return_58_test.dart | 2 +- .../async_invalid_return_59_test.dart | 2 +- .../sync_invalid_return_00_test.dart | 2 +- .../sync_invalid_return_01_test.dart | 2 +- .../sync_invalid_return_02_test.dart | 2 +- .../sync_invalid_return_03_test.dart | 2 +- .../sync_invalid_return_04_test.dart | 2 +- .../sync_invalid_return_05_test.dart | 2 +- .../sync_invalid_return_06_test.dart | 2 +- .../sync_invalid_return_07_test.dart | 2 +- .../sync_invalid_return_08_test.dart | 2 +- .../sync_invalid_return_09_test.dart | 2 +- .../sync_invalid_return_10_test.dart | 2 +- .../sync_invalid_return_11_test.dart | 2 +- .../sync_invalid_return_12_test.dart | 2 +- .../sync_invalid_return_13_test.dart | 2 +- .../sync_invalid_return_14_test.dart | 2 +- .../sync_invalid_return_15_test.dart | 2 +- .../sync_invalid_return_16_test.dart | 2 +- .../sync_invalid_return_17_test.dart | 2 +- .../sync_invalid_return_18_test.dart | 2 +- .../sync_invalid_return_19_test.dart | 2 +- .../sync_invalid_return_20_test.dart | 2 +- .../sync_invalid_return_21_test.dart | 2 +- .../sync_invalid_return_22_test.dart | 2 +- .../sync_invalid_return_23_test.dart | 2 +- .../sync_invalid_return_24_test.dart | 2 +- .../sync_invalid_return_25_test.dart | 2 +- .../sync_invalid_return_26_test.dart | 2 +- .../sync_invalid_return_27_test.dart | 2 +- 125 files changed, 444 insertions(+), 208 deletions(-) create mode 100644 pkg/front_end/testcases/nnbd/dynamic_object_call.dart.textual_outline.expect create mode 100644 pkg/front_end/testcases/nnbd/dynamic_object_call.dart.textual_outline_modelled.expect create mode 100644 pkg/front_end/testcases/nnbd/issue41386.dart.textual_outline.expect create mode 100644 pkg/front_end/testcases/nnbd/issue41386.dart.textual_outline_modelled.expect create mode 100644 pkg/front_end/testcases/nnbd/issue41386b.dart.textual_outline.expect create mode 100644 pkg/front_end/testcases/nnbd/issue41386b.dart.textual_outline_modelled.expect create mode 100644 pkg/front_end/testcases/nnbd/issue41437b.dart.textual_outline.expect create mode 100644 pkg/front_end/testcases/nnbd/issue41437b.dart.textual_outline_modelled.expect create mode 100644 pkg/front_end/testcases/nnbd/issue41437c.dart.textual_outline.expect create mode 100644 pkg/front_end/testcases/nnbd/issue41437c.dart.textual_outline_modelled.expect create mode 100644 pkg/front_end/testcases/nnbd/issue41520.dart.textual_outline.expect create mode 100644 pkg/front_end/testcases/nnbd/issue41520.dart.textual_outline_modelled.expect create mode 100644 pkg/front_end/testcases/nnbd/issue41700a.dart.textual_outline.expect create mode 100644 pkg/front_end/testcases/nnbd/issue41700a.dart.textual_outline_modelled.expect create mode 100644 pkg/front_end/testcases/nnbd/issue41700b.dart.textual_outline.expect create mode 100644 pkg/front_end/testcases/nnbd/issue41700b.dart.textual_outline_modelled.expect create mode 100644 pkg/front_end/testcases/nnbd/never_calls.dart.textual_outline.expect create mode 100644 pkg/front_end/testcases/nnbd/never_calls.dart.textual_outline_modelled.expect create mode 100644 pkg/front_end/testcases/nnbd/never_equals.dart.textual_outline.expect create mode 100644 pkg/front_end/testcases/nnbd/never_equals.dart.textual_outline_modelled.expect create mode 100644 pkg/front_end/testcases/nnbd/redundant_type_casts.dart.textual_outline.expect create mode 100644 pkg/front_end/testcases/nnbd/redundant_type_casts.dart.textual_outline_modelled.expect create mode 100644 pkg/front_end/testcases/nnbd/type_constraint_solving_closures_in_upper_and_lower_bounds.dart.textual_outline.expect create mode 100644 pkg/front_end/testcases/nnbd/type_constraint_solving_closures_in_upper_and_lower_bounds.dart.textual_outline_modelled.expect diff --git a/pkg/front_end/lib/src/fasta/fasta_codes_cfe_generated.dart b/pkg/front_end/lib/src/fasta/fasta_codes_cfe_generated.dart index b4d3941473bc..7bb345392cec 100644 --- a/pkg/front_end/lib/src/fasta/fasta_codes_cfe_generated.dart +++ b/pkg/front_end/lib/src/fasta/fasta_codes_cfe_generated.dart @@ -2040,6 +2040,84 @@ Message _withArgumentsInvalidCastTopLevelFunction( arguments: {'type': _type, 'type2': _type2}); } +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +const Template< + Message Function( + DartType _type, + DartType _type2, + bool + isNonNullableByDefault)> templateInvalidReturn = const Template< + Message Function( + DartType _type, DartType _type2, bool isNonNullableByDefault)>( + messageTemplate: + r"""A value of type '#type' can't be returned from a function with return type '#type2'.""", + withArguments: _withArgumentsInvalidReturn); + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +const Code< + Message Function( + DartType _type, DartType _type2, bool isNonNullableByDefault)> + codeInvalidReturn = const Code< + Message Function( + DartType _type, DartType _type2, bool isNonNullableByDefault)>( + "InvalidReturn", + templateInvalidReturn, +); + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +Message _withArgumentsInvalidReturn( + DartType _type, DartType _type2, bool isNonNullableByDefault) { + TypeLabeler labeler = new TypeLabeler(isNonNullableByDefault); + List typeParts = labeler.labelType(_type); + List type2Parts = labeler.labelType(_type2); + String type = typeParts.join(); + String type2 = type2Parts.join(); + return new Message(codeInvalidReturn, + message: + """A value of type '${type}' can't be returned from a function with return type '${type2}'.""" + + labeler.originMessages, + arguments: {'type': _type, 'type2': _type2}); +} + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +const Template< + Message Function( + DartType _type, + DartType _type2, + bool + isNonNullableByDefault)> templateInvalidReturnAsync = const Template< + Message Function( + DartType _type, DartType _type2, bool isNonNullableByDefault)>( + messageTemplate: + r"""A value of type '#type' can't be returned from an async function with return type '#type2'.""", + withArguments: _withArgumentsInvalidReturnAsync); + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +const Code< + Message Function( + DartType _type, DartType _type2, bool isNonNullableByDefault)> + codeInvalidReturnAsync = const Code< + Message Function( + DartType _type, DartType _type2, bool isNonNullableByDefault)>( + "InvalidReturnAsync", + templateInvalidReturnAsync, +); + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +Message _withArgumentsInvalidReturnAsync( + DartType _type, DartType _type2, bool isNonNullableByDefault) { + TypeLabeler labeler = new TypeLabeler(isNonNullableByDefault); + List typeParts = labeler.labelType(_type); + List type2Parts = labeler.labelType(_type2); + String type = typeParts.join(); + String type2 = type2Parts.join(); + return new Message(codeInvalidReturnAsync, + message: + """A value of type '${type}' can't be returned from an async function with return type '${type2}'.""" + + labeler.originMessages, + arguments: {'type': _type, 'type2': _type2}); +} + // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template< Message Function(DartType _type, DartType _type2, DartType _type3, diff --git a/pkg/front_end/lib/src/fasta/type_inference/closure_context.dart b/pkg/front_end/lib/src/fasta/type_inference/closure_context.dart index 0251f0c7430d..0d8a3af66e71 100644 --- a/pkg/front_end/lib/src/fasta/type_inference/closure_context.dart +++ b/pkg/front_end/lib/src/fasta/type_inference/closure_context.dart @@ -195,7 +195,8 @@ class _SyncClosureContext implements ClosureContext { // nor dynamic, and S is void. statement.expression = inferrer.helper.wrapInProblem( statement.expression, - messageVoidExpression, + templateInvalidReturn.withArguments(expressionType, + _declaredReturnType, inferrer.isNonNullableByDefault), statement.expression.fileOffset, noLength) ..parent = statement; @@ -204,7 +205,9 @@ class _SyncClosureContext implements ClosureContext { // S is not assignable to T. Expression expression = inferrer.ensureAssignable( _returnContext, expressionType, statement.expression, - fileOffset: statement.expression.fileOffset, isVoidAllowed: true); + fileOffset: statement.expression.fileOffset, + isVoidAllowed: true, + errorTemplate: templateInvalidReturn); statement.expression = expression..parent = statement; } } @@ -481,7 +484,8 @@ class _AsyncClosureContext implements ClosureContext { // flatten(S) is neither void, dynamic, Null. statement.expression = inferrer.helper.wrapInProblem( new NullLiteral()..fileOffset = statement.fileOffset, - messageReturnFromVoidFunction, + templateInvalidReturnAsync.withArguments(expressionType, + _declaredReturnType, inferrer.isNonNullableByDefault), statement.expression.fileOffset, noLength) ..parent = statement; @@ -492,25 +496,11 @@ class _AsyncClosureContext implements ClosureContext { // nor dynamic, and flatten(S) is void. statement.expression = inferrer.helper.wrapInProblem( new NullLiteral()..fileOffset = statement.fileOffset, - messageVoidExpression, + templateInvalidReturnAsync.withArguments(expressionType, + _declaredReturnType, inferrer.isNonNullableByDefault), statement.expression.fileOffset, noLength) ..parent = statement; -/* } else if (flattenedExpressionType is! VoidType && - !inferrer.isAssignable(futureValueType, expressionType) && - !inferrer.typeSchemaEnvironment - .performNullabilityAwareSubtypeCheck( - flattenedExpressionType, futureValueType) - .isSubtypeWhenUsingNullabilities()) { - // It is a compile-time error if s is `return e;`, flatten(S) is not - // void, S is not assignable to T_v, and flatten(S) is not a subtype - // of T_v. - statement.expression = inferrer.helper.wrapInProblem( - new NullLiteral()..fileOffset = statement.fileOffset, - messageReturnWithoutExpressionAsync, - statement.expression.fileOffset, - noLength) - ..parent = statement;*/ } else if (flattenedExpressionType is! VoidType && !inferrer.typeSchemaEnvironment .performNullabilityAwareSubtypeCheck( @@ -523,7 +513,9 @@ class _AsyncClosureContext implements ClosureContext { futureValueType, expressionType, statement.expression, fileOffset: statement.expression.fileOffset, runtimeCheckedType: _returnContext, - isVoidAllowed: false) + declaredContextType: _declaredReturnType, + isVoidAllowed: false, + errorTemplate: templateInvalidReturnAsync) ..parent = statement; } } diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart index 9d5ee44e9956..e958804726f1 100644 --- a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart +++ b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart @@ -387,6 +387,13 @@ class TypeInferrerImpl implements TypeInferrer { /// [contextType], and inserts an implicit downcast, inserts a tear-off, or /// reports an error if appropriate. /// + /// If [declaredContextType] is provided, this is used instead of + /// [contextType] for reporting the type against which [expressionType] isn't + /// assignable. This is used when checking the assignability of return + /// statements in async functions in which the assignability is checked + /// against the future value type but the reporting should refer to the + /// declared return type. + /// /// If [runtimeCheckedType] is provided, this is used for the implicit cast, /// otherwise [contextType] is used. This is used for return from async /// where the returned expression is wrapped in a `Future`, if necessary, @@ -395,6 +402,7 @@ class TypeInferrerImpl implements TypeInferrer { Expression ensureAssignable( DartType contextType, DartType expressionType, Expression expression, {int fileOffset, + DartType declaredContextType, DartType runtimeCheckedType, bool isVoidAllowed: false, Template errorTemplate}) { @@ -444,8 +452,8 @@ class TypeInferrerImpl implements TypeInferrer { break; case AssignabilityKind.unassignable: // Error: not assignable. Perform error recovery. - result = _wrapUnassignableExpression( - expression, expressionType, contextType, errorTemplate); + result = _wrapUnassignableExpression(expression, expressionType, + contextType, declaredContextType, errorTemplate); break; case AssignabilityKind.unassignableVoid: // Error: not assignable. Perform error recovery. @@ -465,8 +473,12 @@ class TypeInferrerImpl implements TypeInferrer { case AssignabilityKind.unassignableTearoff: TypedTearoff typedTearoff = _tearOffCall(expression, expressionType, fileOffset); - result = _wrapUnassignableExpression(typedTearoff.tearoff, - typedTearoff.tearoffType, contextType, errorTemplate); + result = _wrapUnassignableExpression( + typedTearoff.tearoff, + typedTearoff.tearoffType, + contextType, + declaredContextType, + errorTemplate); break; case AssignabilityKind.unassignableCantTearoff: result = _wrapTearoffErrorExpression( @@ -505,6 +517,7 @@ class TypeInferrerImpl implements TypeInferrer { Expression expression, DartType expressionType, DartType contextType, + DartType declaredContextType, Template template) { Expression errorNode = new AsExpression( expression, @@ -520,7 +533,9 @@ class TypeInferrerImpl implements TypeInferrer { errorNode = helper.wrapInProblem( errorNode, (template ?? templateInvalidAssignmentError).withArguments( - expressionType, contextType, isNonNullableByDefault), + expressionType, + declaredContextType ?? contextType, + isNonNullableByDefault), errorNode.fileOffset, noLength); } diff --git a/pkg/front_end/messages.status b/pkg/front_end/messages.status index f5a8184a63d8..6e5e16008e56 100644 --- a/pkg/front_end/messages.status +++ b/pkg/front_end/messages.status @@ -415,6 +415,8 @@ InvalidContinueTarget/example: Fail InvalidInitializer/example: Fail InvalidPackageUri/analyzerCode: Fail InvalidPackageUri/example: Fail +InvalidReturn/analyzerCode: Fail +InvalidReturnAsync/analyzerCode: Fail InvalidSuperInInitializer/example: Fail InvalidThisInInitializer/example: Fail InvalidTypeVariableInSupertype/analyzerCode: Fail diff --git a/pkg/front_end/messages.yaml b/pkg/front_end/messages.yaml index 7b44c7447ce5..69e19888590f 100644 --- a/pkg/front_end/messages.yaml +++ b/pkg/front_end/messages.yaml @@ -3413,6 +3413,16 @@ ReturnWithoutExpressionAsync: configuration: nnbd-strong declaration: "Future foo() async { return; }" +InvalidReturn: + template: "A value of type '#type' can't be returned from a function with return type '#type2'." + configuration: nnbd-strong + declaration: "int foo() { return true; }" + +InvalidReturnAsync: + template: "A value of type '#type' can't be returned from an async function with return type '#type2'." + configuration: nnbd-strong + declaration: "Future foo() async { return true; }" + ImplicitReturnNull: template: "A non-null value must be returned since the return type '#type' doesn't allow null." configuration: nnbd-strong diff --git a/pkg/front_end/testcases/nnbd/dynamic_object_call.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/dynamic_object_call.dart.textual_outline.expect new file mode 100644 index 000000000000..5c9aa730e195 --- /dev/null +++ b/pkg/front_end/testcases/nnbd/dynamic_object_call.dart.textual_outline.expect @@ -0,0 +1,9 @@ +class Class { + @override + noSuchMethod(Object o, {String foo = ''}) => 42; + @override + toString({String foo = ''}) => 'foo'; +} + +main() {} +test() {} diff --git a/pkg/front_end/testcases/nnbd/dynamic_object_call.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/nnbd/dynamic_object_call.dart.textual_outline_modelled.expect new file mode 100644 index 000000000000..5c9aa730e195 --- /dev/null +++ b/pkg/front_end/testcases/nnbd/dynamic_object_call.dart.textual_outline_modelled.expect @@ -0,0 +1,9 @@ +class Class { + @override + noSuchMethod(Object o, {String foo = ''}) => 42; + @override + toString({String foo = ''}) => 'foo'; +} + +main() {} +test() {} diff --git a/pkg/front_end/testcases/nnbd/issue41386.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/issue41386.dart.textual_outline.expect new file mode 100644 index 000000000000..cfc22c440188 --- /dev/null +++ b/pkg/front_end/testcases/nnbd/issue41386.dart.textual_outline.expect @@ -0,0 +1,3 @@ +bool Function(T) predicate(bool Function(T) fn) => (T val) => fn(val); +void test() {} +void main() {} diff --git a/pkg/front_end/testcases/nnbd/issue41386.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/nnbd/issue41386.dart.textual_outline_modelled.expect new file mode 100644 index 000000000000..5bfe1f446d20 --- /dev/null +++ b/pkg/front_end/testcases/nnbd/issue41386.dart.textual_outline_modelled.expect @@ -0,0 +1,3 @@ +bool Function(T) predicate(bool Function(T) fn) => (T val) => fn(val); +void main() {} +void test() {} diff --git a/pkg/front_end/testcases/nnbd/issue41386b.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/issue41386b.dart.textual_outline.expect new file mode 100644 index 000000000000..31c91a24220e --- /dev/null +++ b/pkg/front_end/testcases/nnbd/issue41386b.dart.textual_outline.expect @@ -0,0 +1,2 @@ +void test() {} +main() {} diff --git a/pkg/front_end/testcases/nnbd/issue41386b.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/nnbd/issue41386b.dart.textual_outline_modelled.expect new file mode 100644 index 000000000000..4742c78440a1 --- /dev/null +++ b/pkg/front_end/testcases/nnbd/issue41386b.dart.textual_outline_modelled.expect @@ -0,0 +1,2 @@ +main() {} +void test() {} diff --git a/pkg/front_end/testcases/nnbd/issue41437a.dart.strong.expect b/pkg/front_end/testcases/nnbd/issue41437a.dart.strong.expect index 7b3500296697..fbcd99ef51b7 100644 --- a/pkg/front_end/testcases/nnbd/issue41437a.dart.strong.expect +++ b/pkg/front_end/testcases/nnbd/issue41437a.dart.strong.expect @@ -2,12 +2,12 @@ library /*isNonNullableByDefault*/; // // Problems in library: // -// pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future' can't be assigned to a variable of type 'Future'. +// pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future' can't be returned from a function with return type 'Future'. // - 'Future' is from 'dart:async'. // Future test5() => getFutureNull(); // error // ^ // -// pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future' can't be assigned to a variable of type 'Future'. +// pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future' can't be returned from a function with return type 'Future'. // - 'Future' is from 'dart:async'. // Future test5() => getFutureNull(); // error // ^ @@ -48,7 +48,7 @@ static method test3() → core::bool static method test4() → asy::Future async return await self::getFutureNull() as{TypeError,ForDynamic,ForNonNullableByDefault} FutureOr; static method test5() → asy::Future - return let final #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future' can't be assigned to a variable of type 'Future'. + return let final #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future' can't be returned from a function with return type 'Future'. - 'Future' is from 'dart:async'. Future test5() => getFutureNull(); // error ^" in self::getFutureNull() as{TypeError,ForNonNullableByDefault} asy::Future; @@ -66,7 +66,7 @@ static method test() → dynamic async { function test4() → asy::Future async return await self::getFutureNull() as{TypeError,ForDynamic,ForNonNullableByDefault} FutureOr; function test5() → asy::Future - return let final #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future' can't be assigned to a variable of type 'Future'. + return let final #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future' can't be returned from a function with return type 'Future'. - 'Future' is from 'dart:async'. Future test5() => getFutureNull(); // error ^" in self::getFutureNull() as{TypeError,ForNonNullableByDefault} asy::Future; diff --git a/pkg/front_end/testcases/nnbd/issue41437a.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue41437a.dart.strong.transformed.expect index 4efaadff820a..e54c5af3f32c 100644 --- a/pkg/front_end/testcases/nnbd/issue41437a.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/nnbd/issue41437a.dart.strong.transformed.expect @@ -2,12 +2,12 @@ library /*isNonNullableByDefault*/; // // Problems in library: // -// pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future' can't be assigned to a variable of type 'Future'. +// pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future' can't be returned from a function with return type 'Future'. // - 'Future' is from 'dart:async'. // Future test5() => getFutureNull(); // error // ^ // -// pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future' can't be assigned to a variable of type 'Future'. +// pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future' can't be returned from a function with return type 'Future'. // - 'Future' is from 'dart:async'. // Future test5() => getFutureNull(); // error // ^ @@ -150,7 +150,7 @@ static method test4() → asy::Future /* originally async */ { return :async_completer.{asy::Completer::future}; } static method test5() → asy::Future - return let final #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future' can't be assigned to a variable of type 'Future'. + return let final #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future' can't be returned from a function with return type 'Future'. - 'Future' is from 'dart:async'. Future test5() => getFutureNull(); // error ^" in self::getFutureNull() as{TypeError,ForNonNullableByDefault} asy::Future; @@ -258,7 +258,7 @@ static method test() → dynamic /* originally async */ { return :async_completer.{asy::Completer::future}; } function test5() → asy::Future - return let final #t6 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future' can't be assigned to a variable of type 'Future'. + return let final #t6 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future' can't be returned from a function with return type 'Future'. - 'Future' is from 'dart:async'. Future test5() => getFutureNull(); // error ^" in self::getFutureNull() as{TypeError,ForNonNullableByDefault} asy::Future; diff --git a/pkg/front_end/testcases/nnbd/issue41437a.dart.weak.expect b/pkg/front_end/testcases/nnbd/issue41437a.dart.weak.expect index 7b3500296697..fbcd99ef51b7 100644 --- a/pkg/front_end/testcases/nnbd/issue41437a.dart.weak.expect +++ b/pkg/front_end/testcases/nnbd/issue41437a.dart.weak.expect @@ -2,12 +2,12 @@ library /*isNonNullableByDefault*/; // // Problems in library: // -// pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future' can't be assigned to a variable of type 'Future'. +// pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future' can't be returned from a function with return type 'Future'. // - 'Future' is from 'dart:async'. // Future test5() => getFutureNull(); // error // ^ // -// pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future' can't be assigned to a variable of type 'Future'. +// pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future' can't be returned from a function with return type 'Future'. // - 'Future' is from 'dart:async'. // Future test5() => getFutureNull(); // error // ^ @@ -48,7 +48,7 @@ static method test3() → core::bool static method test4() → asy::Future async return await self::getFutureNull() as{TypeError,ForDynamic,ForNonNullableByDefault} FutureOr; static method test5() → asy::Future - return let final #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future' can't be assigned to a variable of type 'Future'. + return let final #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future' can't be returned from a function with return type 'Future'. - 'Future' is from 'dart:async'. Future test5() => getFutureNull(); // error ^" in self::getFutureNull() as{TypeError,ForNonNullableByDefault} asy::Future; @@ -66,7 +66,7 @@ static method test() → dynamic async { function test4() → asy::Future async return await self::getFutureNull() as{TypeError,ForDynamic,ForNonNullableByDefault} FutureOr; function test5() → asy::Future - return let final #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future' can't be assigned to a variable of type 'Future'. + return let final #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future' can't be returned from a function with return type 'Future'. - 'Future' is from 'dart:async'. Future test5() => getFutureNull(); // error ^" in self::getFutureNull() as{TypeError,ForNonNullableByDefault} asy::Future; diff --git a/pkg/front_end/testcases/nnbd/issue41437a.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue41437a.dart.weak.transformed.expect index 4efaadff820a..e54c5af3f32c 100644 --- a/pkg/front_end/testcases/nnbd/issue41437a.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/nnbd/issue41437a.dart.weak.transformed.expect @@ -2,12 +2,12 @@ library /*isNonNullableByDefault*/; // // Problems in library: // -// pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future' can't be assigned to a variable of type 'Future'. +// pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future' can't be returned from a function with return type 'Future'. // - 'Future' is from 'dart:async'. // Future test5() => getFutureNull(); // error // ^ // -// pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future' can't be assigned to a variable of type 'Future'. +// pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future' can't be returned from a function with return type 'Future'. // - 'Future' is from 'dart:async'. // Future test5() => getFutureNull(); // error // ^ @@ -150,7 +150,7 @@ static method test4() → asy::Future /* originally async */ { return :async_completer.{asy::Completer::future}; } static method test5() → asy::Future - return let final #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future' can't be assigned to a variable of type 'Future'. + return let final #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future' can't be returned from a function with return type 'Future'. - 'Future' is from 'dart:async'. Future test5() => getFutureNull(); // error ^" in self::getFutureNull() as{TypeError,ForNonNullableByDefault} asy::Future; @@ -258,7 +258,7 @@ static method test() → dynamic /* originally async */ { return :async_completer.{asy::Completer::future}; } function test5() → asy::Future - return let final #t6 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future' can't be assigned to a variable of type 'Future'. + return let final #t6 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future' can't be returned from a function with return type 'Future'. - 'Future' is from 'dart:async'. Future test5() => getFutureNull(); // error ^" in self::getFutureNull() as{TypeError,ForNonNullableByDefault} asy::Future; diff --git a/pkg/front_end/testcases/nnbd/issue41437b.dart.strong.expect b/pkg/front_end/testcases/nnbd/issue41437b.dart.strong.expect index 3c4069e2b0d0..ca9e7642c688 100644 --- a/pkg/front_end/testcases/nnbd/issue41437b.dart.strong.expect +++ b/pkg/front_end/testcases/nnbd/issue41437b.dart.strong.expect @@ -7,7 +7,7 @@ library /*isNonNullableByDefault*/; // yield* getIterableNull(); // error // ^ // -// pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable' can't be assigned to a variable of type 'Iterable'. +// pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable' can't be returned from a function with return type 'Iterable'. // - 'Iterable' is from 'dart:core'. // Iterable test5() => getIterableNull(); // error // ^ @@ -17,7 +17,7 @@ library /*isNonNullableByDefault*/; // yield* getIterableNull(); // error // ^ // -// pkg/front_end/testcases/nnbd/issue41437b.dart:41:29: Error: A value of type 'Iterable' can't be assigned to a variable of type 'Iterable'. +// pkg/front_end/testcases/nnbd/issue41437b.dart:41:29: Error: A value of type 'Iterable' can't be returned from a function with return type 'Iterable'. // - 'Iterable' is from 'dart:core'. // Iterable test5() => getIterableNull(); // error // ^ @@ -62,7 +62,7 @@ static method test4() → core::Iterable sync* { ^" in self::getIterableNull() as{TypeError,ForNonNullableByDefault} core::Iterable; } static method test5() → core::Iterable - return let final #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable' can't be assigned to a variable of type 'Iterable'. + return let final #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable' can't be returned from a function with return type 'Iterable'. - 'Iterable' is from 'dart:core'. Iterable test5() => getIterableNull(); // error ^" in self::getIterableNull() as{TypeError,ForNonNullableByDefault} core::Iterable; @@ -86,7 +86,7 @@ static method test() → dynamic async { ^" in self::getIterableNull() as{TypeError,ForNonNullableByDefault} core::Iterable; } function test5() → core::Iterable - return let final #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:41:29: Error: A value of type 'Iterable' can't be assigned to a variable of type 'Iterable'. + return let final #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:41:29: Error: A value of type 'Iterable' can't be returned from a function with return type 'Iterable'. - 'Iterable' is from 'dart:core'. Iterable test5() => getIterableNull(); // error ^" in self::getIterableNull() as{TypeError,ForNonNullableByDefault} core::Iterable; diff --git a/pkg/front_end/testcases/nnbd/issue41437b.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue41437b.dart.strong.transformed.expect index 17b627aed265..36cb9dd8dfca 100644 --- a/pkg/front_end/testcases/nnbd/issue41437b.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/nnbd/issue41437b.dart.strong.transformed.expect @@ -7,7 +7,7 @@ library /*isNonNullableByDefault*/; // yield* getIterableNull(); // error // ^ // -// pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable' can't be assigned to a variable of type 'Iterable'. +// pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable' can't be returned from a function with return type 'Iterable'. // - 'Iterable' is from 'dart:core'. // Iterable test5() => getIterableNull(); // error // ^ @@ -17,7 +17,7 @@ library /*isNonNullableByDefault*/; // yield* getIterableNull(); // error // ^ // -// pkg/front_end/testcases/nnbd/issue41437b.dart:41:29: Error: A value of type 'Iterable' can't be assigned to a variable of type 'Iterable'. +// pkg/front_end/testcases/nnbd/issue41437b.dart:41:29: Error: A value of type 'Iterable' can't be returned from a function with return type 'Iterable'. // - 'Iterable' is from 'dart:core'. // Iterable test5() => getIterableNull(); // error // ^ @@ -115,7 +115,7 @@ static method test4() → core::Iterable /* originally sync* */ { return new core::_SyncIterable::•(:sync_op_gen); } static method test5() → core::Iterable - return let final #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable' can't be assigned to a variable of type 'Iterable'. + return let final #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable' can't be returned from a function with return type 'Iterable'. - 'Iterable' is from 'dart:core'. Iterable test5() => getIterableNull(); // error ^" in self::getIterableNull() as{TypeError,ForNonNullableByDefault} core::Iterable; @@ -189,7 +189,7 @@ static method test() → dynamic /* originally async */ { return new core::_SyncIterable::•(:sync_op_gen); } function test5() → core::Iterable - return let final #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:41:29: Error: A value of type 'Iterable' can't be assigned to a variable of type 'Iterable'. + return let final #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:41:29: Error: A value of type 'Iterable' can't be returned from a function with return type 'Iterable'. - 'Iterable' is from 'dart:core'. Iterable test5() => getIterableNull(); // error ^" in self::getIterableNull() as{TypeError,ForNonNullableByDefault} core::Iterable; diff --git a/pkg/front_end/testcases/nnbd/issue41437b.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/issue41437b.dart.textual_outline.expect new file mode 100644 index 000000000000..cec88c6c5d51 --- /dev/null +++ b/pkg/front_end/testcases/nnbd/issue41437b.dart.textual_outline.expect @@ -0,0 +1,12 @@ +dynamic getNull() => null; +Iterable getIterableNull() sync* {} +Iterable getIterableBool() sync* {} +Iterable test1() sync* {} +Iterable test2() => getNull(); +bool test3() => getNull(); +Iterable test4() sync* {} +Iterable test5() => getIterableNull(); +Iterable test6() => getIterableBool(); +Iterable test7() sync* {} +test() async {} +main() {} diff --git a/pkg/front_end/testcases/nnbd/issue41437b.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/nnbd/issue41437b.dart.textual_outline_modelled.expect new file mode 100644 index 000000000000..f215cc1e8a52 --- /dev/null +++ b/pkg/front_end/testcases/nnbd/issue41437b.dart.textual_outline_modelled.expect @@ -0,0 +1,12 @@ +Iterable getIterableBool() sync* {} +Iterable test1() sync* {} +Iterable test2() => getNull(); +Iterable test4() sync* {} +Iterable test5() => getIterableNull(); +Iterable test6() => getIterableBool(); +Iterable test7() sync* {} +Iterable getIterableNull() sync* {} +bool test3() => getNull(); +dynamic getNull() => null; +main() {} +test() async {} diff --git a/pkg/front_end/testcases/nnbd/issue41437b.dart.weak.expect b/pkg/front_end/testcases/nnbd/issue41437b.dart.weak.expect index 3c4069e2b0d0..ca9e7642c688 100644 --- a/pkg/front_end/testcases/nnbd/issue41437b.dart.weak.expect +++ b/pkg/front_end/testcases/nnbd/issue41437b.dart.weak.expect @@ -7,7 +7,7 @@ library /*isNonNullableByDefault*/; // yield* getIterableNull(); // error // ^ // -// pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable' can't be assigned to a variable of type 'Iterable'. +// pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable' can't be returned from a function with return type 'Iterable'. // - 'Iterable' is from 'dart:core'. // Iterable test5() => getIterableNull(); // error // ^ @@ -17,7 +17,7 @@ library /*isNonNullableByDefault*/; // yield* getIterableNull(); // error // ^ // -// pkg/front_end/testcases/nnbd/issue41437b.dart:41:29: Error: A value of type 'Iterable' can't be assigned to a variable of type 'Iterable'. +// pkg/front_end/testcases/nnbd/issue41437b.dart:41:29: Error: A value of type 'Iterable' can't be returned from a function with return type 'Iterable'. // - 'Iterable' is from 'dart:core'. // Iterable test5() => getIterableNull(); // error // ^ @@ -62,7 +62,7 @@ static method test4() → core::Iterable sync* { ^" in self::getIterableNull() as{TypeError,ForNonNullableByDefault} core::Iterable; } static method test5() → core::Iterable - return let final #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable' can't be assigned to a variable of type 'Iterable'. + return let final #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable' can't be returned from a function with return type 'Iterable'. - 'Iterable' is from 'dart:core'. Iterable test5() => getIterableNull(); // error ^" in self::getIterableNull() as{TypeError,ForNonNullableByDefault} core::Iterable; @@ -86,7 +86,7 @@ static method test() → dynamic async { ^" in self::getIterableNull() as{TypeError,ForNonNullableByDefault} core::Iterable; } function test5() → core::Iterable - return let final #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:41:29: Error: A value of type 'Iterable' can't be assigned to a variable of type 'Iterable'. + return let final #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:41:29: Error: A value of type 'Iterable' can't be returned from a function with return type 'Iterable'. - 'Iterable' is from 'dart:core'. Iterable test5() => getIterableNull(); // error ^" in self::getIterableNull() as{TypeError,ForNonNullableByDefault} core::Iterable; diff --git a/pkg/front_end/testcases/nnbd/issue41437b.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue41437b.dart.weak.transformed.expect index 17b627aed265..36cb9dd8dfca 100644 --- a/pkg/front_end/testcases/nnbd/issue41437b.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/nnbd/issue41437b.dart.weak.transformed.expect @@ -7,7 +7,7 @@ library /*isNonNullableByDefault*/; // yield* getIterableNull(); // error // ^ // -// pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable' can't be assigned to a variable of type 'Iterable'. +// pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable' can't be returned from a function with return type 'Iterable'. // - 'Iterable' is from 'dart:core'. // Iterable test5() => getIterableNull(); // error // ^ @@ -17,7 +17,7 @@ library /*isNonNullableByDefault*/; // yield* getIterableNull(); // error // ^ // -// pkg/front_end/testcases/nnbd/issue41437b.dart:41:29: Error: A value of type 'Iterable' can't be assigned to a variable of type 'Iterable'. +// pkg/front_end/testcases/nnbd/issue41437b.dart:41:29: Error: A value of type 'Iterable' can't be returned from a function with return type 'Iterable'. // - 'Iterable' is from 'dart:core'. // Iterable test5() => getIterableNull(); // error // ^ @@ -115,7 +115,7 @@ static method test4() → core::Iterable /* originally sync* */ { return new core::_SyncIterable::•(:sync_op_gen); } static method test5() → core::Iterable - return let final #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable' can't be assigned to a variable of type 'Iterable'. + return let final #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable' can't be returned from a function with return type 'Iterable'. - 'Iterable' is from 'dart:core'. Iterable test5() => getIterableNull(); // error ^" in self::getIterableNull() as{TypeError,ForNonNullableByDefault} core::Iterable; @@ -189,7 +189,7 @@ static method test() → dynamic /* originally async */ { return new core::_SyncIterable::•(:sync_op_gen); } function test5() → core::Iterable - return let final #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:41:29: Error: A value of type 'Iterable' can't be assigned to a variable of type 'Iterable'. + return let final #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:41:29: Error: A value of type 'Iterable' can't be returned from a function with return type 'Iterable'. - 'Iterable' is from 'dart:core'. Iterable test5() => getIterableNull(); // error ^" in self::getIterableNull() as{TypeError,ForNonNullableByDefault} core::Iterable; diff --git a/pkg/front_end/testcases/nnbd/issue41437c.dart.strong.expect b/pkg/front_end/testcases/nnbd/issue41437c.dart.strong.expect index 16b4fb1843be..c020c721dd89 100644 --- a/pkg/front_end/testcases/nnbd/issue41437c.dart.strong.expect +++ b/pkg/front_end/testcases/nnbd/issue41437c.dart.strong.expect @@ -7,7 +7,7 @@ library /*isNonNullableByDefault*/; // yield* getStreamNull(); // error // ^ // -// pkg/front_end/testcases/nnbd/issue41437c.dart:24:25: Error: A value of type 'Stream' can't be assigned to a variable of type 'Stream'. +// pkg/front_end/testcases/nnbd/issue41437c.dart:24:25: Error: A value of type 'Stream' can't be returned from a function with return type 'Stream'. // - 'Stream' is from 'dart:async'. // Stream test5() => getStreamNull(); // error // ^ @@ -17,7 +17,7 @@ library /*isNonNullableByDefault*/; // yield* getStreamNull(); // error // ^ // -// pkg/front_end/testcases/nnbd/issue41437c.dart:41:27: Error: A value of type 'Stream' can't be assigned to a variable of type 'Stream'. +// pkg/front_end/testcases/nnbd/issue41437c.dart:41:27: Error: A value of type 'Stream' can't be returned from a function with return type 'Stream'. // - 'Stream' is from 'dart:async'. // Stream test5() => getStreamNull(); // error // ^ @@ -63,7 +63,7 @@ static method test4() → asy::Stream async* { ^" in self::getStreamNull() as{TypeError,ForNonNullableByDefault} asy::Stream; } static method test5() → asy::Stream - return let final #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437c.dart:24:25: Error: A value of type 'Stream' can't be assigned to a variable of type 'Stream'. + return let final #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437c.dart:24:25: Error: A value of type 'Stream' can't be returned from a function with return type 'Stream'. - 'Stream' is from 'dart:async'. Stream test5() => getStreamNull(); // error ^" in self::getStreamNull() as{TypeError,ForNonNullableByDefault} asy::Stream; @@ -87,7 +87,7 @@ static method test() → dynamic async { ^" in self::getStreamNull() as{TypeError,ForNonNullableByDefault} asy::Stream; } function test5() → asy::Stream - return let final #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437c.dart:41:27: Error: A value of type 'Stream' can't be assigned to a variable of type 'Stream'. + return let final #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437c.dart:41:27: Error: A value of type 'Stream' can't be returned from a function with return type 'Stream'. - 'Stream' is from 'dart:async'. Stream test5() => getStreamNull(); // error ^" in self::getStreamNull() as{TypeError,ForNonNullableByDefault} asy::Stream; diff --git a/pkg/front_end/testcases/nnbd/issue41437c.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue41437c.dart.strong.transformed.expect index 06f62bb22d3c..71bc53a32254 100644 --- a/pkg/front_end/testcases/nnbd/issue41437c.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/nnbd/issue41437c.dart.strong.transformed.expect @@ -7,7 +7,7 @@ library /*isNonNullableByDefault*/; // yield* getStreamNull(); // error // ^ // -// pkg/front_end/testcases/nnbd/issue41437c.dart:24:25: Error: A value of type 'Stream' can't be assigned to a variable of type 'Stream'. +// pkg/front_end/testcases/nnbd/issue41437c.dart:24:25: Error: A value of type 'Stream' can't be returned from a function with return type 'Stream'. // - 'Stream' is from 'dart:async'. // Stream test5() => getStreamNull(); // error // ^ @@ -17,7 +17,7 @@ library /*isNonNullableByDefault*/; // yield* getStreamNull(); // error // ^ // -// pkg/front_end/testcases/nnbd/issue41437c.dart:41:27: Error: A value of type 'Stream' can't be assigned to a variable of type 'Stream'. +// pkg/front_end/testcases/nnbd/issue41437c.dart:41:27: Error: A value of type 'Stream' can't be returned from a function with return type 'Stream'. // - 'Stream' is from 'dart:async'. // Stream test5() => getStreamNull(); // error // ^ @@ -191,7 +191,7 @@ static method test4() → asy::Stream /* originally async* */ { return :controller_stream; } static method test5() → asy::Stream - return let final #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437c.dart:24:25: Error: A value of type 'Stream' can't be assigned to a variable of type 'Stream'. + return let final #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437c.dart:24:25: Error: A value of type 'Stream' can't be returned from a function with return type 'Stream'. - 'Stream' is from 'dart:async'. Stream test5() => getStreamNull(); // error ^" in self::getStreamNull() as{TypeError,ForNonNullableByDefault} asy::Stream; @@ -322,7 +322,7 @@ static method test() → dynamic /* originally async */ { return :controller_stream; } function test5() → asy::Stream - return let final #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437c.dart:41:27: Error: A value of type 'Stream' can't be assigned to a variable of type 'Stream'. + return let final #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437c.dart:41:27: Error: A value of type 'Stream' can't be returned from a function with return type 'Stream'. - 'Stream' is from 'dart:async'. Stream test5() => getStreamNull(); // error ^" in self::getStreamNull() as{TypeError,ForNonNullableByDefault} asy::Stream; diff --git a/pkg/front_end/testcases/nnbd/issue41437c.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/issue41437c.dart.textual_outline.expect new file mode 100644 index 000000000000..25fb625f5140 --- /dev/null +++ b/pkg/front_end/testcases/nnbd/issue41437c.dart.textual_outline.expect @@ -0,0 +1,12 @@ +dynamic getNull() => null; +Stream getStreamNull() async* {} +Stream getStreamBool() async* {} +Stream test1() async* {} +Stream test2() => getNull(); +bool test3() => getNull(); +Stream test4() async* {} +Stream test5() => getStreamNull(); +Stream test6() => getStreamBool(); +Stream test7() async* {} +test() async {} +main() {} diff --git a/pkg/front_end/testcases/nnbd/issue41437c.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/nnbd/issue41437c.dart.textual_outline_modelled.expect new file mode 100644 index 000000000000..08bd1530f854 --- /dev/null +++ b/pkg/front_end/testcases/nnbd/issue41437c.dart.textual_outline_modelled.expect @@ -0,0 +1,12 @@ +Stream getStreamBool() async* {} +Stream test1() async* {} +Stream test2() => getNull(); +Stream test4() async* {} +Stream test5() => getStreamNull(); +Stream test6() => getStreamBool(); +Stream test7() async* {} +Stream getStreamNull() async* {} +bool test3() => getNull(); +dynamic getNull() => null; +main() {} +test() async {} diff --git a/pkg/front_end/testcases/nnbd/issue41437c.dart.weak.expect b/pkg/front_end/testcases/nnbd/issue41437c.dart.weak.expect index 16b4fb1843be..c020c721dd89 100644 --- a/pkg/front_end/testcases/nnbd/issue41437c.dart.weak.expect +++ b/pkg/front_end/testcases/nnbd/issue41437c.dart.weak.expect @@ -7,7 +7,7 @@ library /*isNonNullableByDefault*/; // yield* getStreamNull(); // error // ^ // -// pkg/front_end/testcases/nnbd/issue41437c.dart:24:25: Error: A value of type 'Stream' can't be assigned to a variable of type 'Stream'. +// pkg/front_end/testcases/nnbd/issue41437c.dart:24:25: Error: A value of type 'Stream' can't be returned from a function with return type 'Stream'. // - 'Stream' is from 'dart:async'. // Stream test5() => getStreamNull(); // error // ^ @@ -17,7 +17,7 @@ library /*isNonNullableByDefault*/; // yield* getStreamNull(); // error // ^ // -// pkg/front_end/testcases/nnbd/issue41437c.dart:41:27: Error: A value of type 'Stream' can't be assigned to a variable of type 'Stream'. +// pkg/front_end/testcases/nnbd/issue41437c.dart:41:27: Error: A value of type 'Stream' can't be returned from a function with return type 'Stream'. // - 'Stream' is from 'dart:async'. // Stream test5() => getStreamNull(); // error // ^ @@ -63,7 +63,7 @@ static method test4() → asy::Stream async* { ^" in self::getStreamNull() as{TypeError,ForNonNullableByDefault} asy::Stream; } static method test5() → asy::Stream - return let final #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437c.dart:24:25: Error: A value of type 'Stream' can't be assigned to a variable of type 'Stream'. + return let final #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437c.dart:24:25: Error: A value of type 'Stream' can't be returned from a function with return type 'Stream'. - 'Stream' is from 'dart:async'. Stream test5() => getStreamNull(); // error ^" in self::getStreamNull() as{TypeError,ForNonNullableByDefault} asy::Stream; @@ -87,7 +87,7 @@ static method test() → dynamic async { ^" in self::getStreamNull() as{TypeError,ForNonNullableByDefault} asy::Stream; } function test5() → asy::Stream - return let final #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437c.dart:41:27: Error: A value of type 'Stream' can't be assigned to a variable of type 'Stream'. + return let final #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437c.dart:41:27: Error: A value of type 'Stream' can't be returned from a function with return type 'Stream'. - 'Stream' is from 'dart:async'. Stream test5() => getStreamNull(); // error ^" in self::getStreamNull() as{TypeError,ForNonNullableByDefault} asy::Stream; diff --git a/pkg/front_end/testcases/nnbd/issue41437c.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue41437c.dart.weak.transformed.expect index 06f62bb22d3c..71bc53a32254 100644 --- a/pkg/front_end/testcases/nnbd/issue41437c.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/nnbd/issue41437c.dart.weak.transformed.expect @@ -7,7 +7,7 @@ library /*isNonNullableByDefault*/; // yield* getStreamNull(); // error // ^ // -// pkg/front_end/testcases/nnbd/issue41437c.dart:24:25: Error: A value of type 'Stream' can't be assigned to a variable of type 'Stream'. +// pkg/front_end/testcases/nnbd/issue41437c.dart:24:25: Error: A value of type 'Stream' can't be returned from a function with return type 'Stream'. // - 'Stream' is from 'dart:async'. // Stream test5() => getStreamNull(); // error // ^ @@ -17,7 +17,7 @@ library /*isNonNullableByDefault*/; // yield* getStreamNull(); // error // ^ // -// pkg/front_end/testcases/nnbd/issue41437c.dart:41:27: Error: A value of type 'Stream' can't be assigned to a variable of type 'Stream'. +// pkg/front_end/testcases/nnbd/issue41437c.dart:41:27: Error: A value of type 'Stream' can't be returned from a function with return type 'Stream'. // - 'Stream' is from 'dart:async'. // Stream test5() => getStreamNull(); // error // ^ @@ -191,7 +191,7 @@ static method test4() → asy::Stream /* originally async* */ { return :controller_stream; } static method test5() → asy::Stream - return let final #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437c.dart:24:25: Error: A value of type 'Stream' can't be assigned to a variable of type 'Stream'. + return let final #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437c.dart:24:25: Error: A value of type 'Stream' can't be returned from a function with return type 'Stream'. - 'Stream' is from 'dart:async'. Stream test5() => getStreamNull(); // error ^" in self::getStreamNull() as{TypeError,ForNonNullableByDefault} asy::Stream; @@ -322,7 +322,7 @@ static method test() → dynamic /* originally async */ { return :controller_stream; } function test5() → asy::Stream - return let final #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437c.dart:41:27: Error: A value of type 'Stream' can't be assigned to a variable of type 'Stream'. + return let final #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437c.dart:41:27: Error: A value of type 'Stream' can't be returned from a function with return type 'Stream'. - 'Stream' is from 'dart:async'. Stream test5() => getStreamNull(); // error ^" in self::getStreamNull() as{TypeError,ForNonNullableByDefault} asy::Stream; diff --git a/pkg/front_end/testcases/nnbd/issue41520.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/issue41520.dart.textual_outline.expect new file mode 100644 index 000000000000..1abae431da6e --- /dev/null +++ b/pkg/front_end/testcases/nnbd/issue41520.dart.textual_outline.expect @@ -0,0 +1,4 @@ +void errors() {} +void _takesObject(Object o) {} +void _takesStackTrace(StackTrace o) {} +void main() {} diff --git a/pkg/front_end/testcases/nnbd/issue41520.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/nnbd/issue41520.dart.textual_outline_modelled.expect new file mode 100644 index 000000000000..10c705d55900 --- /dev/null +++ b/pkg/front_end/testcases/nnbd/issue41520.dart.textual_outline_modelled.expect @@ -0,0 +1,4 @@ +void _takesObject(Object o) {} +void _takesStackTrace(StackTrace o) {} +void errors() {} +void main() {} diff --git a/pkg/front_end/testcases/nnbd/issue41700a.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/issue41700a.dart.textual_outline.expect new file mode 100644 index 000000000000..ec6b9e024455 --- /dev/null +++ b/pkg/front_end/testcases/nnbd/issue41700a.dart.textual_outline.expect @@ -0,0 +1,2 @@ +test() {} +main() {} diff --git a/pkg/front_end/testcases/nnbd/issue41700a.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/nnbd/issue41700a.dart.textual_outline_modelled.expect new file mode 100644 index 000000000000..f67dbb0fde59 --- /dev/null +++ b/pkg/front_end/testcases/nnbd/issue41700a.dart.textual_outline_modelled.expect @@ -0,0 +1,2 @@ +main() {} +test() {} diff --git a/pkg/front_end/testcases/nnbd/issue41700b.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/issue41700b.dart.textual_outline.expect new file mode 100644 index 000000000000..54124f573c2c --- /dev/null +++ b/pkg/front_end/testcases/nnbd/issue41700b.dart.textual_outline.expect @@ -0,0 +1,4 @@ +class Null {} + +test() {} +main() {} diff --git a/pkg/front_end/testcases/nnbd/issue41700b.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/nnbd/issue41700b.dart.textual_outline_modelled.expect new file mode 100644 index 000000000000..6684200bd634 --- /dev/null +++ b/pkg/front_end/testcases/nnbd/issue41700b.dart.textual_outline_modelled.expect @@ -0,0 +1,4 @@ +class Null {} + +main() {} +test() {} diff --git a/pkg/front_end/testcases/nnbd/never_calls.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/never_calls.dart.textual_outline.expect new file mode 100644 index 000000000000..54bd347a00b1 --- /dev/null +++ b/pkg/front_end/testcases/nnbd/never_calls.dart.textual_outline.expect @@ -0,0 +1,6 @@ +propertyGet(Never never) {} +propertySet(Never never) {} +methodInvocation(Never never, Invocation invocation) {} +equals(Never never) {} +operator(Never never) {} +main() {} diff --git a/pkg/front_end/testcases/nnbd/never_calls.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/nnbd/never_calls.dart.textual_outline_modelled.expect new file mode 100644 index 000000000000..4dcbb4ace6eb --- /dev/null +++ b/pkg/front_end/testcases/nnbd/never_calls.dart.textual_outline_modelled.expect @@ -0,0 +1,6 @@ +equals(Never never) {} +main() {} +methodInvocation(Never never, Invocation invocation) {} +operator(Never never) {} +propertyGet(Never never) {} +propertySet(Never never) {} diff --git a/pkg/front_end/testcases/nnbd/never_equals.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/never_equals.dart.textual_outline.expect new file mode 100644 index 000000000000..a38ad6648354 --- /dev/null +++ b/pkg/front_end/testcases/nnbd/never_equals.dart.textual_outline.expect @@ -0,0 +1,2 @@ +test(Never nonNullableNever, Never? nullableNever) {} +main() {} diff --git a/pkg/front_end/testcases/nnbd/never_equals.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/nnbd/never_equals.dart.textual_outline_modelled.expect new file mode 100644 index 000000000000..d9aa494c2343 --- /dev/null +++ b/pkg/front_end/testcases/nnbd/never_equals.dart.textual_outline_modelled.expect @@ -0,0 +1,2 @@ +main() {} +test(Never nonNullableNever, Never? nullableNever) {} diff --git a/pkg/front_end/testcases/nnbd/redundant_type_casts.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/redundant_type_casts.dart.textual_outline.expect new file mode 100644 index 000000000000..f56a0d9552e2 --- /dev/null +++ b/pkg/front_end/testcases/nnbd/redundant_type_casts.dart.textual_outline.expect @@ -0,0 +1,6 @@ +class A { + T? _current; + T get current => _current as T; +} + +main() {} diff --git a/pkg/front_end/testcases/nnbd/redundant_type_casts.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/nnbd/redundant_type_casts.dart.textual_outline_modelled.expect new file mode 100644 index 000000000000..268c6683d247 --- /dev/null +++ b/pkg/front_end/testcases/nnbd/redundant_type_casts.dart.textual_outline_modelled.expect @@ -0,0 +1,6 @@ +class A { + T get current => _current as T; + T? _current; +} + +main() {} diff --git a/pkg/front_end/testcases/nnbd/return_null.dart.strong.expect b/pkg/front_end/testcases/nnbd/return_null.dart.strong.expect index b9743eb27b7d..ec3912f9ecfa 100644 --- a/pkg/front_end/testcases/nnbd/return_null.dart.strong.expect +++ b/pkg/front_end/testcases/nnbd/return_null.dart.strong.expect @@ -6,11 +6,11 @@ library /*isNonNullableByDefault*/; // String returnImplicit() /*error*/ { // ^ // -// pkg/front_end/testcases/nnbd/return_null.dart:13:10: Error: A value of type 'Null' can't be assigned to a variable of type 'String'. +// pkg/front_end/testcases/nnbd/return_null.dart:13:10: Error: A value of type 'Null' can't be returned from a function with return type 'String'. // return null; // error // ^ // -// pkg/front_end/testcases/nnbd/return_null.dart:19:12: Error: A value of type 'Null' can't be assigned to a variable of type 'String'. +// pkg/front_end/testcases/nnbd/return_null.dart:19:12: Error: A value of type 'Null' can't be returned from a function with return type 'String'. // return null; // error // ^ // @@ -31,11 +31,11 @@ library /*isNonNullableByDefault*/; // String returnImplicit() /* error */ { // ^ // -// pkg/front_end/testcases/nnbd/return_null.dart:69:12: Error: A value of type 'Null' can't be assigned to a variable of type 'String'. +// pkg/front_end/testcases/nnbd/return_null.dart:69:12: Error: A value of type 'Null' can't be returned from a function with return type 'String'. // return null; // error // ^ // -// pkg/front_end/testcases/nnbd/return_null.dart:75:14: Error: A value of type 'Null' can't be assigned to a variable of type 'String'. +// pkg/front_end/testcases/nnbd/return_null.dart:75:14: Error: A value of type 'Null' can't be returned from a function with return type 'String'. // return null; // error // ^ // @@ -82,14 +82,14 @@ String returnImplicit() /*error*/ { } static method returnExplicit() → core::String { core::print("foo"); - return let final #t2 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:13:10: Error: A value of type 'Null' can't be assigned to a variable of type 'String'. + return let final #t2 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:13:10: Error: A value of type 'Null' can't be returned from a function with return type 'String'. return null; // error ^" in null as{TypeError,ForNonNullableByDefault} core::String; } static method returnMixed(core::bool b) → core::String { if(b) { core::print("foo"); - return let final #t3 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:19:12: Error: A value of type 'Null' can't be assigned to a variable of type 'String'. + return let final #t3 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:19:12: Error: A value of type 'Null' can't be returned from a function with return type 'String'. return null; // error ^" in null as{TypeError,ForNonNullableByDefault} core::String; } @@ -151,14 +151,14 @@ static method localFunctions() → dynamic { } function returnExplicit() → core::String { core::print("foo"); - return let final #t8 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:69:12: Error: A value of type 'Null' can't be assigned to a variable of type 'String'. + return let final #t8 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:69:12: Error: A value of type 'Null' can't be returned from a function with return type 'String'. return null; // error ^" in null as{TypeError,ForNonNullableByDefault} core::String; } function returnMixed(core::bool b) → core::String { if(b) { core::print("foo"); - return let final #t9 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:75:14: Error: A value of type 'Null' can't be assigned to a variable of type 'String'. + return let final #t9 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:75:14: Error: A value of type 'Null' can't be returned from a function with return type 'String'. return null; // error ^" in null as{TypeError,ForNonNullableByDefault} core::String; } diff --git a/pkg/front_end/testcases/nnbd/return_null.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/return_null.dart.strong.transformed.expect index e9cbf0cc083e..e697630dd8d0 100644 --- a/pkg/front_end/testcases/nnbd/return_null.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/nnbd/return_null.dart.strong.transformed.expect @@ -6,11 +6,11 @@ library /*isNonNullableByDefault*/; // String returnImplicit() /*error*/ { // ^ // -// pkg/front_end/testcases/nnbd/return_null.dart:13:10: Error: A value of type 'Null' can't be assigned to a variable of type 'String'. +// pkg/front_end/testcases/nnbd/return_null.dart:13:10: Error: A value of type 'Null' can't be returned from a function with return type 'String'. // return null; // error // ^ // -// pkg/front_end/testcases/nnbd/return_null.dart:19:12: Error: A value of type 'Null' can't be assigned to a variable of type 'String'. +// pkg/front_end/testcases/nnbd/return_null.dart:19:12: Error: A value of type 'Null' can't be returned from a function with return type 'String'. // return null; // error // ^ // @@ -31,11 +31,11 @@ library /*isNonNullableByDefault*/; // String returnImplicit() /* error */ { // ^ // -// pkg/front_end/testcases/nnbd/return_null.dart:69:12: Error: A value of type 'Null' can't be assigned to a variable of type 'String'. +// pkg/front_end/testcases/nnbd/return_null.dart:69:12: Error: A value of type 'Null' can't be returned from a function with return type 'String'. // return null; // error // ^ // -// pkg/front_end/testcases/nnbd/return_null.dart:75:14: Error: A value of type 'Null' can't be assigned to a variable of type 'String'. +// pkg/front_end/testcases/nnbd/return_null.dart:75:14: Error: A value of type 'Null' can't be returned from a function with return type 'String'. // return null; // error // ^ // @@ -82,14 +82,14 @@ String returnImplicit() /*error*/ { } static method returnExplicit() → core::String { core::print("foo"); - return let final #t2 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:13:10: Error: A value of type 'Null' can't be assigned to a variable of type 'String'. + return let final #t2 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:13:10: Error: A value of type 'Null' can't be returned from a function with return type 'String'. return null; // error ^" in let core::Null? #t3 = null in #t3.==(null) ?{core::String} #t3 as{TypeError,ForNonNullableByDefault} core::String : #t3{core::String}; } static method returnMixed(core::bool b) → core::String { if(b) { core::print("foo"); - return let final #t4 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:19:12: Error: A value of type 'Null' can't be assigned to a variable of type 'String'. + return let final #t4 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:19:12: Error: A value of type 'Null' can't be returned from a function with return type 'String'. return null; // error ^" in let core::Null? #t5 = null in #t5.==(null) ?{core::String} #t5 as{TypeError,ForNonNullableByDefault} core::String : #t5{core::String}; } @@ -351,14 +351,14 @@ static method localFunctions() → dynamic { } function returnExplicit() → core::String { core::print("foo"); - return let final #t10 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:69:12: Error: A value of type 'Null' can't be assigned to a variable of type 'String'. + return let final #t10 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:69:12: Error: A value of type 'Null' can't be returned from a function with return type 'String'. return null; // error ^" in let core::Null? #t11 = null in #t11.==(null) ?{core::String} #t11 as{TypeError,ForNonNullableByDefault} core::String : #t11{core::String}; } function returnMixed(core::bool b) → core::String { if(b) { core::print("foo"); - return let final #t12 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:75:14: Error: A value of type 'Null' can't be assigned to a variable of type 'String'. + return let final #t12 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:75:14: Error: A value of type 'Null' can't be returned from a function with return type 'String'. return null; // error ^" in let core::Null? #t13 = null in #t13.==(null) ?{core::String} #t13 as{TypeError,ForNonNullableByDefault} core::String : #t13{core::String}; } diff --git a/pkg/front_end/testcases/nnbd/return_null.dart.weak.expect b/pkg/front_end/testcases/nnbd/return_null.dart.weak.expect index c0505b58ad76..2aff0f0b3ecd 100644 --- a/pkg/front_end/testcases/nnbd/return_null.dart.weak.expect +++ b/pkg/front_end/testcases/nnbd/return_null.dart.weak.expect @@ -6,11 +6,11 @@ library /*isNonNullableByDefault*/; // String returnImplicit() /*error*/ { // ^ // -// pkg/front_end/testcases/nnbd/return_null.dart:13:10: Error: A value of type 'Null' can't be assigned to a variable of type 'String'. +// pkg/front_end/testcases/nnbd/return_null.dart:13:10: Error: A value of type 'Null' can't be returned from a function with return type 'String'. // return null; // error // ^ // -// pkg/front_end/testcases/nnbd/return_null.dart:19:12: Error: A value of type 'Null' can't be assigned to a variable of type 'String'. +// pkg/front_end/testcases/nnbd/return_null.dart:19:12: Error: A value of type 'Null' can't be returned from a function with return type 'String'. // return null; // error // ^ // @@ -31,11 +31,11 @@ library /*isNonNullableByDefault*/; // String returnImplicit() /* error */ { // ^ // -// pkg/front_end/testcases/nnbd/return_null.dart:69:12: Error: A value of type 'Null' can't be assigned to a variable of type 'String'. +// pkg/front_end/testcases/nnbd/return_null.dart:69:12: Error: A value of type 'Null' can't be returned from a function with return type 'String'. // return null; // error // ^ // -// pkg/front_end/testcases/nnbd/return_null.dart:75:14: Error: A value of type 'Null' can't be assigned to a variable of type 'String'. +// pkg/front_end/testcases/nnbd/return_null.dart:75:14: Error: A value of type 'Null' can't be returned from a function with return type 'String'. // return null; // error // ^ // @@ -82,14 +82,14 @@ String returnImplicit() /*error*/ { } static method returnExplicit() → core::String { core::print("foo"); - return let final #t2 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:13:10: Error: A value of type 'Null' can't be assigned to a variable of type 'String'. + return let final #t2 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:13:10: Error: A value of type 'Null' can't be returned from a function with return type 'String'. return null; // error ^" in null as{TypeError,ForNonNullableByDefault} core::String; } static method returnMixed(core::bool b) → core::String { if(b) { core::print("foo"); - return let final #t3 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:19:12: Error: A value of type 'Null' can't be assigned to a variable of type 'String'. + return let final #t3 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:19:12: Error: A value of type 'Null' can't be returned from a function with return type 'String'. return null; // error ^" in null as{TypeError,ForNonNullableByDefault} core::String; } @@ -151,14 +151,14 @@ static method localFunctions() → dynamic { } function returnExplicit() → core::String { core::print("foo"); - return let final #t8 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:69:12: Error: A value of type 'Null' can't be assigned to a variable of type 'String'. + return let final #t8 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:69:12: Error: A value of type 'Null' can't be returned from a function with return type 'String'. return null; // error ^" in null as{TypeError,ForNonNullableByDefault} core::String; } function returnMixed(core::bool b) → core::String { if(b) { core::print("foo"); - return let final #t9 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:75:14: Error: A value of type 'Null' can't be assigned to a variable of type 'String'. + return let final #t9 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:75:14: Error: A value of type 'Null' can't be returned from a function with return type 'String'. return null; // error ^" in null as{TypeError,ForNonNullableByDefault} core::String; } diff --git a/pkg/front_end/testcases/nnbd/return_null.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/return_null.dart.weak.transformed.expect index 755ad61d258d..e888a45141aa 100644 --- a/pkg/front_end/testcases/nnbd/return_null.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/nnbd/return_null.dart.weak.transformed.expect @@ -6,11 +6,11 @@ library /*isNonNullableByDefault*/; // String returnImplicit() /*error*/ { // ^ // -// pkg/front_end/testcases/nnbd/return_null.dart:13:10: Error: A value of type 'Null' can't be assigned to a variable of type 'String'. +// pkg/front_end/testcases/nnbd/return_null.dart:13:10: Error: A value of type 'Null' can't be returned from a function with return type 'String'. // return null; // error // ^ // -// pkg/front_end/testcases/nnbd/return_null.dart:19:12: Error: A value of type 'Null' can't be assigned to a variable of type 'String'. +// pkg/front_end/testcases/nnbd/return_null.dart:19:12: Error: A value of type 'Null' can't be returned from a function with return type 'String'. // return null; // error // ^ // @@ -31,11 +31,11 @@ library /*isNonNullableByDefault*/; // String returnImplicit() /* error */ { // ^ // -// pkg/front_end/testcases/nnbd/return_null.dart:69:12: Error: A value of type 'Null' can't be assigned to a variable of type 'String'. +// pkg/front_end/testcases/nnbd/return_null.dart:69:12: Error: A value of type 'Null' can't be returned from a function with return type 'String'. // return null; // error // ^ // -// pkg/front_end/testcases/nnbd/return_null.dart:75:14: Error: A value of type 'Null' can't be assigned to a variable of type 'String'. +// pkg/front_end/testcases/nnbd/return_null.dart:75:14: Error: A value of type 'Null' can't be returned from a function with return type 'String'. // return null; // error // ^ // @@ -82,14 +82,14 @@ String returnImplicit() /*error*/ { } static method returnExplicit() → core::String { core::print("foo"); - return let final #t2 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:13:10: Error: A value of type 'Null' can't be assigned to a variable of type 'String'. + return let final #t2 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:13:10: Error: A value of type 'Null' can't be returned from a function with return type 'String'. return null; // error ^" in null; } static method returnMixed(core::bool b) → core::String { if(b) { core::print("foo"); - return let final #t3 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:19:12: Error: A value of type 'Null' can't be assigned to a variable of type 'String'. + return let final #t3 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:19:12: Error: A value of type 'Null' can't be returned from a function with return type 'String'. return null; // error ^" in null; } @@ -351,14 +351,14 @@ static method localFunctions() → dynamic { } function returnExplicit() → core::String { core::print("foo"); - return let final #t8 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:69:12: Error: A value of type 'Null' can't be assigned to a variable of type 'String'. + return let final #t8 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:69:12: Error: A value of type 'Null' can't be returned from a function with return type 'String'. return null; // error ^" in null; } function returnMixed(core::bool b) → core::String { if(b) { core::print("foo"); - return let final #t9 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:75:14: Error: A value of type 'Null' can't be assigned to a variable of type 'String'. + return let final #t9 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:75:14: Error: A value of type 'Null' can't be returned from a function with return type 'String'. return null; // error ^" in null; } diff --git a/pkg/front_end/testcases/nnbd/type_constraint_solving_closures_in_upper_and_lower_bounds.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/type_constraint_solving_closures_in_upper_and_lower_bounds.dart.textual_outline.expect new file mode 100644 index 000000000000..fa80f6b2ea52 --- /dev/null +++ b/pkg/front_end/testcases/nnbd/type_constraint_solving_closures_in_upper_and_lower_bounds.dart.textual_outline.expect @@ -0,0 +1,7 @@ +class C { + C(void Function(X) x); +} + +T check(C> f) {} +void test() {} +main() {} diff --git a/pkg/front_end/testcases/nnbd/type_constraint_solving_closures_in_upper_and_lower_bounds.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/nnbd/type_constraint_solving_closures_in_upper_and_lower_bounds.dart.textual_outline_modelled.expect new file mode 100644 index 000000000000..bf84124c91a9 --- /dev/null +++ b/pkg/front_end/testcases/nnbd/type_constraint_solving_closures_in_upper_and_lower_bounds.dart.textual_outline_modelled.expect @@ -0,0 +1,8 @@ +T check(C> f) {} + +class C { + C(void Function(X) x); +} + +main() {} +void test() {} diff --git a/pkg/front_end/testcases/nnbd_mixed/never_opt_out.dart.weak.expect b/pkg/front_end/testcases/nnbd_mixed/never_opt_out.dart.weak.expect index ad7f2b89b4e7..444f273f193d 100644 --- a/pkg/front_end/testcases/nnbd_mixed/never_opt_out.dart.weak.expect +++ b/pkg/front_end/testcases/nnbd_mixed/never_opt_out.dart.weak.expect @@ -122,7 +122,7 @@ library /*isNonNullableByDefault*/; // // Problems in library: // -// pkg/front_end/testcases/nnbd_mixed/never_opt_out_lib.dart:19:28: Error: A value of type 'Type' can't be assigned to a variable of type 'Null'. +// pkg/front_end/testcases/nnbd_mixed/never_opt_out_lib.dart:19:28: Error: A value of type 'Type' can't be returned from a function with return type 'Null'. // - 'Type' is from 'dart:core'. // Null get nullProperty => Null; // ^ @@ -147,7 +147,7 @@ class A extends core::Object { method nullMethod(core::Null? value) → core::Null? return value; get nullProperty() → core::Null? - return let final #t1 = invalid-expression "pkg/front_end/testcases/nnbd_mixed/never_opt_out_lib.dart:19:28: Error: A value of type 'Type' can't be assigned to a variable of type 'Null'. + return let final #t1 = invalid-expression "pkg/front_end/testcases/nnbd_mixed/never_opt_out_lib.dart:19:28: Error: A value of type 'Type' can't be returned from a function with return type 'Null'. - 'Type' is from 'dart:core'. Null get nullProperty => Null; ^" in core::Null? as{TypeError,ForNonNullableByDefault} core::Null?; diff --git a/tests/language/factory/return_type_checked_test.dart b/tests/language/factory/return_type_checked_test.dart index c882f4fe1327..0cff11288f8d 100644 --- a/tests/language/factory/return_type_checked_test.dart +++ b/tests/language/factory/return_type_checked_test.dart @@ -8,7 +8,7 @@ class A { factory A() => 42; // ^^ // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE - // [cfe] A value of type 'int' can't be assigned to a variable of type 'A'. + // [cfe] A value of type 'int' can't be returned from a function with return type 'A'. } main() { diff --git a/tests/language/implicit_downcast_during/function_literal_arrow_test.dart b/tests/language/implicit_downcast_during/function_literal_arrow_test.dart index 3f5950e0527d..409ae5b7128a 100644 --- a/tests/language/implicit_downcast_during/function_literal_arrow_test.dart +++ b/tests/language/implicit_downcast_during/function_literal_arrow_test.dart @@ -11,5 +11,5 @@ void main() { B Function(A) f = (A a) => a; // ^ // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE_FROM_CLOSURE - // [cfe] A value of type 'A' can't be assigned to a variable of type 'B'. + // [cfe] A value of type 'A' can't be returned from a function with return type 'B'. } diff --git a/tests/language/implicit_downcast_during/function_literal_return_test.dart b/tests/language/implicit_downcast_during/function_literal_return_test.dart index f7862a11c65e..1c7a056c11a7 100644 --- a/tests/language/implicit_downcast_during/function_literal_return_test.dart +++ b/tests/language/implicit_downcast_during/function_literal_return_test.dart @@ -12,6 +12,6 @@ void main() { return a; // ^ // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE_FROM_CLOSURE - // [cfe] A value of type 'A' can't be assigned to a variable of type 'B'. + // [cfe] A value of type 'A' can't be returned from a function with return type 'B'. }; } diff --git a/tests/language/implicit_downcast_during/return_async_test.dart b/tests/language/implicit_downcast_during/return_async_test.dart index a976d1ed3cdf..34d041e5d3af 100644 --- a/tests/language/implicit_downcast_during/return_async_test.dart +++ b/tests/language/implicit_downcast_during/return_async_test.dart @@ -13,14 +13,14 @@ Future f1(A a) async { // ^^^^^^^^^^^^^^^^ // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE // ^ - // [cfe] A value of type 'FutureOr' can't be assigned to a variable of type 'B'. + // [cfe] A value of type 'FutureOr' can't be returned from an async function with return type 'Future'. } Future f2(A a) async => a as FutureOr; // ^^^^^^^^^^^^^^^^ // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE // ^ -// [cfe] A value of type 'FutureOr' can't be assigned to a variable of type 'B'. +// [cfe] A value of type 'FutureOr' can't be returned from an async function with return type 'Future'. main() async { Object b; diff --git a/tests/language/implicit_downcast_during/return_test.dart b/tests/language/implicit_downcast_during/return_test.dart index 3bbffe8925fe..e858dc481c4f 100644 --- a/tests/language/implicit_downcast_during/return_test.dart +++ b/tests/language/implicit_downcast_during/return_test.dart @@ -10,13 +10,13 @@ B f1(A a) { return a; // ^ // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE - // [cfe] A value of type 'A' can't be assigned to a variable of type 'B'. + // [cfe] A value of type 'A' can't be returned from a function with return type 'B'. } B f2(A a) => a; // ^ // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE -// [cfe] A value of type 'A' can't be assigned to a variable of type 'B'. +// [cfe] A value of type 'A' can't be returned from a function with return type 'B'. void main() { Object b; diff --git a/tests/language/invalid_returns/async_invalid_return_00_test.dart b/tests/language/invalid_returns/async_invalid_return_00_test.dart index 6df27908ec1e..b5e14e19afe0 100644 --- a/tests/language/invalid_returns/async_invalid_return_00_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_00_test.dart @@ -12,14 +12,14 @@ Object test1() async { return; //^ // [analyzer] unspecified -// [cfe] unspecified +// [cfe] A value must be explicitly returned from a non-void async function. } Object? test2() async { return; //^ // [analyzer] unspecified -// [cfe] unspecified +// [cfe] A value must be explicitly returned from a non-void async function. } // Inferred return type of function literal is `Future`, no error. diff --git a/tests/language/invalid_returns/async_invalid_return_01_test.dart b/tests/language/invalid_returns/async_invalid_return_01_test.dart index e2b0e9bbd72a..a502d3f00553 100644 --- a/tests/language/invalid_returns/async_invalid_return_01_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_01_test.dart @@ -12,14 +12,14 @@ Future test1() async { return; //^ // [analyzer] unspecified -// [cfe] unspecified +// [cfe] A value must be explicitly returned from a non-void async function. } Future Function() test2 = () async { return; //^ // [analyzer] unspecified -// [cfe] unspecified +// [cfe] A value must be explicitly returned from a non-void async function. }; void main() { diff --git a/tests/language/invalid_returns/async_invalid_return_02_test.dart b/tests/language/invalid_returns/async_invalid_return_02_test.dart index 1b36160cda50..ad814cf016cf 100644 --- a/tests/language/invalid_returns/async_invalid_return_02_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_02_test.dart @@ -12,14 +12,14 @@ FutureOr test1() async { return; //^ // [analyzer] unspecified -// [cfe] unspecified +// [cfe] A value must be explicitly returned from a non-void async function. } FutureOr Function() test2 = () async { return; //^ // [analyzer] unspecified -// [cfe] unspecified +// [cfe] A value must be explicitly returned from a non-void async function. }; void main() { diff --git a/tests/language/invalid_returns/async_invalid_return_03_test.dart b/tests/language/invalid_returns/async_invalid_return_03_test.dart index 784540440fe4..4b42e267d5a3 100644 --- a/tests/language/invalid_returns/async_invalid_return_03_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_03_test.dart @@ -12,7 +12,7 @@ Future test1() async { return; //^ // [analyzer] unspecified -// [cfe] unspecified +// [cfe] A value must be explicitly returned from a non-void async function. } // Inferred return type of function literal is `Future`, no error. diff --git a/tests/language/invalid_returns/async_invalid_return_04_test.dart b/tests/language/invalid_returns/async_invalid_return_04_test.dart index 4c0b19335281..648a1af86999 100644 --- a/tests/language/invalid_returns/async_invalid_return_04_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_04_test.dart @@ -12,7 +12,7 @@ FutureOr test1() async { return; //^ // [analyzer] unspecified -// [cfe] unspecified +// [cfe] A value must be explicitly returned from a non-void async function. } // Inferred return type of function literal is `Future`, no error. diff --git a/tests/language/invalid_returns/async_invalid_return_05_test.dart b/tests/language/invalid_returns/async_invalid_return_05_test.dart index d11a4b58ac77..02316200e328 100644 --- a/tests/language/invalid_returns/async_invalid_return_05_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_05_test.dart @@ -15,7 +15,7 @@ void test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'int' can't be returned from an async function with return type 'void'. } // Inferred return type of function literal is `Future`, no error. diff --git a/tests/language/invalid_returns/async_invalid_return_08_test.dart b/tests/language/invalid_returns/async_invalid_return_08_test.dart index 09950acc9cdc..13281583300c 100644 --- a/tests/language/invalid_returns/async_invalid_return_08_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_08_test.dart @@ -15,7 +15,7 @@ void test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'Object' can't be returned from an async function with return type 'void'. } // Inferred return type of function literal is `Future`, no error. diff --git a/tests/language/invalid_returns/async_invalid_return_11_test.dart b/tests/language/invalid_returns/async_invalid_return_11_test.dart index b85f731a9c8f..51e7e700f7df 100644 --- a/tests/language/invalid_returns/async_invalid_return_11_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_11_test.dart @@ -15,7 +15,7 @@ void test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'Future?' can't be returned from an async function with return type 'void'. } // Inferred return type of function literal is `Future`, no error. diff --git a/tests/language/invalid_returns/async_invalid_return_14_test.dart b/tests/language/invalid_returns/async_invalid_return_14_test.dart index 3eaa71573f96..bbb77942701f 100644 --- a/tests/language/invalid_returns/async_invalid_return_14_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_14_test.dart @@ -15,7 +15,7 @@ void test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'FutureOr' can't be returned from an async function with return type 'void'. } // Inferred return type of function literal is `Future`, no error. diff --git a/tests/language/invalid_returns/async_invalid_return_17_test.dart b/tests/language/invalid_returns/async_invalid_return_17_test.dart index f347a214fcad..69c72cbfa448 100644 --- a/tests/language/invalid_returns/async_invalid_return_17_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_17_test.dart @@ -15,7 +15,7 @@ void test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'Future' can't be returned from an async function with return type 'void'. } // Inferred return type of function literal is `Future`, no error. diff --git a/tests/language/invalid_returns/async_invalid_return_20_test.dart b/tests/language/invalid_returns/async_invalid_return_20_test.dart index 5b54f780cca7..3be0b09c655c 100644 --- a/tests/language/invalid_returns/async_invalid_return_20_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_20_test.dart @@ -15,7 +15,7 @@ void test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'FutureOr' can't be returned from an async function with return type 'void'. } // Inferred return type of function literal is `Future`, no error. diff --git a/tests/language/invalid_returns/async_invalid_return_23_test.dart b/tests/language/invalid_returns/async_invalid_return_23_test.dart index f496a74b99f8..37b6fdb825f4 100644 --- a/tests/language/invalid_returns/async_invalid_return_23_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_23_test.dart @@ -15,14 +15,14 @@ Object test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'void' can't be returned from an async function with return type 'Object'. } Object? test2() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'void' can't be returned from an async function with return type 'Object?'. } // Inferred return type of function literal is `Future`, no error. diff --git a/tests/language/invalid_returns/async_invalid_return_24_test.dart b/tests/language/invalid_returns/async_invalid_return_24_test.dart index 1ccbca784afd..1a57405c2e32 100644 --- a/tests/language/invalid_returns/async_invalid_return_24_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_24_test.dart @@ -15,14 +15,14 @@ Object test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'Future?' can't be returned from an async function with return type 'Object'. } Object? test2() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'Future?' can't be returned from an async function with return type 'Object?'. } // Inferred return type of function literal is `Future`, no error. diff --git a/tests/language/invalid_returns/async_invalid_return_25_test.dart b/tests/language/invalid_returns/async_invalid_return_25_test.dart index 5991e70fe3c7..c080c43a6a47 100644 --- a/tests/language/invalid_returns/async_invalid_return_25_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_25_test.dart @@ -15,14 +15,14 @@ Object test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'FutureOr' can't be returned from an async function with return type 'Object'. } Object? test2() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'FutureOr' can't be returned from an async function with return type 'Object?'. } // Inferred return type of function literal is `Future`, no error. diff --git a/tests/language/invalid_returns/async_invalid_return_26_test.dart b/tests/language/invalid_returns/async_invalid_return_26_test.dart index d99d60c9fbc6..729e3dc17fa2 100644 --- a/tests/language/invalid_returns/async_invalid_return_26_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_26_test.dart @@ -18,7 +18,7 @@ Future test() async { return v; // ^ // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE - // [cfe] This expression has type 'void' and can't be used. + // [cfe] A value of type 'void' can't be returned from an async function with return type 'Future'. } void main() { diff --git a/tests/language/invalid_returns/async_invalid_return_27_test.dart b/tests/language/invalid_returns/async_invalid_return_27_test.dart index 6b2faba31c39..4650891c4e45 100644 --- a/tests/language/invalid_returns/async_invalid_return_27_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_27_test.dart @@ -17,7 +17,7 @@ Future test() async { return v; // ^ // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE - // [cfe] This expression has type 'void' and can't be used. + // [cfe] A value of type 'Future' can't be returned from an async function with return type 'Future'. } void main() { diff --git a/tests/language/invalid_returns/async_invalid_return_28_test.dart b/tests/language/invalid_returns/async_invalid_return_28_test.dart index 416b1272b9f6..dd0219813e9c 100644 --- a/tests/language/invalid_returns/async_invalid_return_28_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_28_test.dart @@ -17,7 +17,7 @@ Future test() async { return v; // ^ // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE - // [cfe] This expression has type 'void' and can't be used. + // [cfe] A value of type 'FutureOr' can't be returned from an async function with return type 'Future'. } void main() { diff --git a/tests/language/invalid_returns/async_invalid_return_29_test.dart b/tests/language/invalid_returns/async_invalid_return_29_test.dart index dd8a9e28298e..b2c96c05345c 100644 --- a/tests/language/invalid_returns/async_invalid_return_29_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_29_test.dart @@ -18,7 +18,7 @@ FutureOr test() async { return v; // ^ // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE - // [cfe] This expression has type 'void' and can't be used. + // [cfe] A value of type 'void' can't be returned from an async function with return type 'FutureOr'. } void main() { diff --git a/tests/language/invalid_returns/async_invalid_return_30_test.dart b/tests/language/invalid_returns/async_invalid_return_30_test.dart index 605f4c9153fc..b8e09b5dde19 100644 --- a/tests/language/invalid_returns/async_invalid_return_30_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_30_test.dart @@ -17,7 +17,7 @@ FutureOr test() async { return v; // ^ // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE - // [cfe] This expression has type 'void' and can't be used. + // [cfe] A value of type 'Future' can't be returned from an async function with return type 'FutureOr'. } void main() { diff --git a/tests/language/invalid_returns/async_invalid_return_31_test.dart b/tests/language/invalid_returns/async_invalid_return_31_test.dart index 9d5ac6cba296..f35985b2208e 100644 --- a/tests/language/invalid_returns/async_invalid_return_31_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_31_test.dart @@ -17,7 +17,7 @@ FutureOr test() async { return v; // ^ // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE - // [cfe] This expression has type 'void' and can't be used. + // [cfe] A value of type 'FutureOr' can't be returned from an async function with return type 'FutureOr'. } void main() { diff --git a/tests/language/invalid_returns/async_invalid_return_32_test.dart b/tests/language/invalid_returns/async_invalid_return_32_test.dart index eaac87626e05..0c2f96d24ea0 100644 --- a/tests/language/invalid_returns/async_invalid_return_32_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_32_test.dart @@ -15,7 +15,7 @@ Future test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'void' can't be returned from an async function with return type 'Future'. } // Inferred return type of function literal is `Future`, no error. diff --git a/tests/language/invalid_returns/async_invalid_return_33_test.dart b/tests/language/invalid_returns/async_invalid_return_33_test.dart index 971b4aacdffa..30c61e6f0554 100644 --- a/tests/language/invalid_returns/async_invalid_return_33_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_33_test.dart @@ -15,7 +15,7 @@ Future test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'Future' can't be returned from an async function with return type 'Future'. } // Inferred return type of function literal is `Future`, no error. diff --git a/tests/language/invalid_returns/async_invalid_return_34_test.dart b/tests/language/invalid_returns/async_invalid_return_34_test.dart index 581542144d48..d53823975aa5 100644 --- a/tests/language/invalid_returns/async_invalid_return_34_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_34_test.dart @@ -15,7 +15,7 @@ Future test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'FutureOr' can't be returned from an async function with return type 'Future'. } // Inferred return type of function literal is `Future`, no error. diff --git a/tests/language/invalid_returns/async_invalid_return_35_test.dart b/tests/language/invalid_returns/async_invalid_return_35_test.dart index b9ddf703b74a..877663198cc8 100644 --- a/tests/language/invalid_returns/async_invalid_return_35_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_35_test.dart @@ -15,7 +15,7 @@ FutureOr test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'void' can't be returned from an async function with return type 'FutureOr'. } // Inferred return type of function literal is `Future`, no error. diff --git a/tests/language/invalid_returns/async_invalid_return_36_test.dart b/tests/language/invalid_returns/async_invalid_return_36_test.dart index 7586e9a1fcf7..3dd6635ccf6d 100644 --- a/tests/language/invalid_returns/async_invalid_return_36_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_36_test.dart @@ -15,21 +15,21 @@ FutureOr test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'Future' can't be returned from an async function with return type 'FutureOr'. } FutureOr test2() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'Future' can't be returned from an async function with return type 'FutureOr'. } FutureOr Function() test3 = () async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'Future' can't be returned from an async function with return type 'FutureOr'. }; // Inferred return type of function literal is `Future`, no error. diff --git a/tests/language/invalid_returns/async_invalid_return_37_test.dart b/tests/language/invalid_returns/async_invalid_return_37_test.dart index 6b0496d05246..da078a4b1efb 100644 --- a/tests/language/invalid_returns/async_invalid_return_37_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_37_test.dart @@ -15,7 +15,7 @@ FutureOr test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'FutureOr' can't be returned from an async function with return type 'FutureOr'. } // Inferred return type of function literal is `Future`, no error. diff --git a/tests/language/invalid_returns/async_invalid_return_38_test.dart b/tests/language/invalid_returns/async_invalid_return_38_test.dart index 3f185922f516..09a761bc14a2 100644 --- a/tests/language/invalid_returns/async_invalid_return_38_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_38_test.dart @@ -15,14 +15,14 @@ Future test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'int' can't be returned from an async function with return type 'Future'. } Future Function() test2 = () async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'int' can't be returned from an async function with return type 'Future'. }; void main() { diff --git a/tests/language/invalid_returns/async_invalid_return_39_test.dart b/tests/language/invalid_returns/async_invalid_return_39_test.dart index 80deb7f9455b..03879e4ff234 100644 --- a/tests/language/invalid_returns/async_invalid_return_39_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_39_test.dart @@ -15,14 +15,14 @@ Future test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'Future' can't be returned from an async function with return type 'Future'. } Future Function() test2 = () async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'Future' can't be returned from an async function with return type 'Future'. }; void main() { diff --git a/tests/language/invalid_returns/async_invalid_return_40_test.dart b/tests/language/invalid_returns/async_invalid_return_40_test.dart index 71589c8d8b85..9fc9eb073050 100644 --- a/tests/language/invalid_returns/async_invalid_return_40_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_40_test.dart @@ -15,14 +15,14 @@ Future test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'FutureOr' can't be returned from an async function with return type 'Future'. } Future Function() test2 = () async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'FutureOr' can't be returned from an async function with return type 'Future'. }; void main() { diff --git a/tests/language/invalid_returns/async_invalid_return_41_test.dart b/tests/language/invalid_returns/async_invalid_return_41_test.dart index d68b8ef97cd5..819d0df8a04f 100644 --- a/tests/language/invalid_returns/async_invalid_return_41_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_41_test.dart @@ -15,14 +15,14 @@ Future test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'Future>' can't be returned from an async function with return type 'Future'. } Future Function() test2 = () async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'Future>' can't be returned from an async function with return type 'Future'. }; void main() { diff --git a/tests/language/invalid_returns/async_invalid_return_42_test.dart b/tests/language/invalid_returns/async_invalid_return_42_test.dart index 098825356f61..cda21d898063 100644 --- a/tests/language/invalid_returns/async_invalid_return_42_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_42_test.dart @@ -15,14 +15,14 @@ FutureOr test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'int' can't be returned from an async function with return type 'FutureOr'. } FutureOr Function() test2 = () async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'int' can't be returned from an async function with return type 'FutureOr'. }; void main() { diff --git a/tests/language/invalid_returns/async_invalid_return_43_test.dart b/tests/language/invalid_returns/async_invalid_return_43_test.dart index dbb5b1d029a9..523334b5c052 100644 --- a/tests/language/invalid_returns/async_invalid_return_43_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_43_test.dart @@ -15,14 +15,14 @@ FutureOr test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'Future' can't be returned from an async function with return type 'FutureOr'. } FutureOr Function() test2 = () async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'Future' can't be returned from an async function with return type 'FutureOr'. }; void main() { diff --git a/tests/language/invalid_returns/async_invalid_return_44_test.dart b/tests/language/invalid_returns/async_invalid_return_44_test.dart index c9adfeb0a8f0..7802e0ea58bf 100644 --- a/tests/language/invalid_returns/async_invalid_return_44_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_44_test.dart @@ -15,14 +15,14 @@ FutureOr test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'FutureOr' can't be returned from an async function with return type 'FutureOr'. } FutureOr Function() test2 = () async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'FutureOr' can't be returned from an async function with return type 'FutureOr'. }; void main() { diff --git a/tests/language/invalid_returns/async_invalid_return_45_test.dart b/tests/language/invalid_returns/async_invalid_return_45_test.dart index bf75dc20bfd0..fe62d1cf8928 100644 --- a/tests/language/invalid_returns/async_invalid_return_45_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_45_test.dart @@ -15,14 +15,14 @@ FutureOr test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'Future>' can't be returned from an async function with return type 'FutureOr'. } FutureOr Function() test2 = () async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'Future>' can't be returned from an async function with return type 'FutureOr'. }; void main() { diff --git a/tests/language/invalid_returns/async_invalid_return_47_test.dart b/tests/language/invalid_returns/async_invalid_return_47_test.dart index e39b36cad972..0ee1f2bf937b 100644 --- a/tests/language/invalid_returns/async_invalid_return_47_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_47_test.dart @@ -15,7 +15,7 @@ Future test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'Future' can't be returned from an async function with return type 'Future'. } // Inferred return type of function literal is `Future`. @@ -23,7 +23,7 @@ Future Function() test2 = () async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'Future' can't be returned from an async function with return type 'Future'. }; void main() { diff --git a/tests/language/invalid_returns/async_invalid_return_48_test.dart b/tests/language/invalid_returns/async_invalid_return_48_test.dart index d60f94809098..b97e7453d4ba 100644 --- a/tests/language/invalid_returns/async_invalid_return_48_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_48_test.dart @@ -15,7 +15,7 @@ Future test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'FutureOr' can't be returned from an async function with return type 'Future'. } // Inferred return type of function literal is `Future`. @@ -23,7 +23,7 @@ Future Function() test2 = () async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'FutureOr' can't be returned from an async function with return type 'Future'. }; void main() { diff --git a/tests/language/invalid_returns/async_invalid_return_50_test.dart b/tests/language/invalid_returns/async_invalid_return_50_test.dart index 236f512ecfed..76f2a5a4b32f 100644 --- a/tests/language/invalid_returns/async_invalid_return_50_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_50_test.dart @@ -15,7 +15,7 @@ FutureOr test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'Future' can't be returned from an async function with return type 'FutureOr'. } // Inferred return type of function literal is `Future`. @@ -23,7 +23,7 @@ FutureOr Function() test2 = () async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'Future' can't be returned from an async function with return type 'FutureOr'. }; void main() { diff --git a/tests/language/invalid_returns/async_invalid_return_51_test.dart b/tests/language/invalid_returns/async_invalid_return_51_test.dart index 3448c144e3f3..c0d90c06dbcb 100644 --- a/tests/language/invalid_returns/async_invalid_return_51_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_51_test.dart @@ -15,7 +15,7 @@ FutureOr test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'FutureOr' can't be returned from an async function with return type 'FutureOr'. } // Inferred return type of function literal is `Future`. @@ -23,7 +23,7 @@ FutureOr Function() test2 = () async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'FutureOr' can't be returned from an async function with return type 'FutureOr'. }; void main() { diff --git a/tests/language/invalid_returns/async_invalid_return_52_test.dart b/tests/language/invalid_returns/async_invalid_return_52_test.dart index 8f086b2a6d1c..59c5f925a23d 100644 --- a/tests/language/invalid_returns/async_invalid_return_52_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_52_test.dart @@ -15,7 +15,7 @@ Future test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'int' can't be returned from an async function with return type 'Future'. } // Inferred return type of function literal is `Future`, no error. diff --git a/tests/language/invalid_returns/async_invalid_return_53_test.dart b/tests/language/invalid_returns/async_invalid_return_53_test.dart index d51ae11b44ce..056bed3eae1d 100644 --- a/tests/language/invalid_returns/async_invalid_return_53_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_53_test.dart @@ -15,7 +15,7 @@ Future test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'Object' can't be returned from an async function with return type 'Future'. } // Inferred return type of function literal is `Future`, no error. diff --git a/tests/language/invalid_returns/async_invalid_return_54_test.dart b/tests/language/invalid_returns/async_invalid_return_54_test.dart index 4dd661aa98d5..2b32e31617e4 100644 --- a/tests/language/invalid_returns/async_invalid_return_54_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_54_test.dart @@ -15,7 +15,7 @@ Future test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'FutureOr' can't be returned from an async function with return type 'Future'. } // Inferred return type of function literal is `Future`, no error. diff --git a/tests/language/invalid_returns/async_invalid_return_55_test.dart b/tests/language/invalid_returns/async_invalid_return_55_test.dart index 72f944095cbe..2e5f5547ff7c 100644 --- a/tests/language/invalid_returns/async_invalid_return_55_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_55_test.dart @@ -15,7 +15,7 @@ Future test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'Future' can't be returned from an async function with return type 'Future'. } // Inferred return type of function literal is `Future`, no error. diff --git a/tests/language/invalid_returns/async_invalid_return_56_test.dart b/tests/language/invalid_returns/async_invalid_return_56_test.dart index 9443436bcd42..c11c8b9c96a3 100644 --- a/tests/language/invalid_returns/async_invalid_return_56_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_56_test.dart @@ -15,7 +15,7 @@ FutureOr test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'int' can't be returned from an async function with return type 'FutureOr'. } // Inferred return type of function literal is `Future`, no error. diff --git a/tests/language/invalid_returns/async_invalid_return_57_test.dart b/tests/language/invalid_returns/async_invalid_return_57_test.dart index 633be9397142..5f4667f9d953 100644 --- a/tests/language/invalid_returns/async_invalid_return_57_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_57_test.dart @@ -15,7 +15,7 @@ FutureOr test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'Object' can't be returned from an async function with return type 'FutureOr'. } // Inferred return type of function literal is `Future`, no error. diff --git a/tests/language/invalid_returns/async_invalid_return_58_test.dart b/tests/language/invalid_returns/async_invalid_return_58_test.dart index 4d508eb07f27..8a1928d79867 100644 --- a/tests/language/invalid_returns/async_invalid_return_58_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_58_test.dart @@ -15,7 +15,7 @@ FutureOr test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'FutureOr' can't be returned from an async function with return type 'FutureOr'. } // Inferred return type of function literal is `Future`, no error. diff --git a/tests/language/invalid_returns/async_invalid_return_59_test.dart b/tests/language/invalid_returns/async_invalid_return_59_test.dart index 95399b9c015f..282404e442e8 100644 --- a/tests/language/invalid_returns/async_invalid_return_59_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_59_test.dart @@ -15,7 +15,7 @@ FutureOr test1() async { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'Future' can't be returned from an async function with return type 'FutureOr'. } // Inferred return type of function literal is `Future`, no error. diff --git a/tests/language/invalid_returns/sync_invalid_return_00_test.dart b/tests/language/invalid_returns/sync_invalid_return_00_test.dart index 1c368e0c1550..251919317d38 100644 --- a/tests/language/invalid_returns/sync_invalid_return_00_test.dart +++ b/tests/language/invalid_returns/sync_invalid_return_00_test.dart @@ -11,7 +11,7 @@ int? test() { return; //^ // [analyzer] unspecified -// [cfe] unspecified +// [cfe] A value must be explicitly returned from a non-void function. } void main() { diff --git a/tests/language/invalid_returns/sync_invalid_return_01_test.dart b/tests/language/invalid_returns/sync_invalid_return_01_test.dart index a2909167e186..2e04fe8d2c25 100644 --- a/tests/language/invalid_returns/sync_invalid_return_01_test.dart +++ b/tests/language/invalid_returns/sync_invalid_return_01_test.dart @@ -11,7 +11,7 @@ Object? test() { return; //^ // [analyzer] unspecified -// [cfe] unspecified +// [cfe] A value must be explicitly returned from a non-void function. } void main() { diff --git a/tests/language/invalid_returns/sync_invalid_return_02_test.dart b/tests/language/invalid_returns/sync_invalid_return_02_test.dart index 05db4f25377b..3009f48264fa 100644 --- a/tests/language/invalid_returns/sync_invalid_return_02_test.dart +++ b/tests/language/invalid_returns/sync_invalid_return_02_test.dart @@ -11,7 +11,7 @@ Future? test() { return; //^ // [analyzer] unspecified -// [cfe] unspecified +// [cfe] A value must be explicitly returned from a non-void function. } void main() { diff --git a/tests/language/invalid_returns/sync_invalid_return_03_test.dart b/tests/language/invalid_returns/sync_invalid_return_03_test.dart index 411619161dac..d031ecfafd3f 100644 --- a/tests/language/invalid_returns/sync_invalid_return_03_test.dart +++ b/tests/language/invalid_returns/sync_invalid_return_03_test.dart @@ -11,7 +11,7 @@ FutureOr test() { return; //^ // [analyzer] unspecified -// [cfe] unspecified +// [cfe] A value must be explicitly returned from a non-void function. } void main() { diff --git a/tests/language/invalid_returns/sync_invalid_return_04_test.dart b/tests/language/invalid_returns/sync_invalid_return_04_test.dart index 1a80d62e030a..6e26a3ac56ba 100644 --- a/tests/language/invalid_returns/sync_invalid_return_04_test.dart +++ b/tests/language/invalid_returns/sync_invalid_return_04_test.dart @@ -11,7 +11,7 @@ Future? test() { return; //^ // [analyzer] unspecified -// [cfe] unspecified +// [cfe] A value must be explicitly returned from a non-void function. } void main() { diff --git a/tests/language/invalid_returns/sync_invalid_return_05_test.dart b/tests/language/invalid_returns/sync_invalid_return_05_test.dart index 27daec48d662..1c3d43ccb017 100644 --- a/tests/language/invalid_returns/sync_invalid_return_05_test.dart +++ b/tests/language/invalid_returns/sync_invalid_return_05_test.dart @@ -11,7 +11,7 @@ FutureOr test() { return; //^ // [analyzer] unspecified -// [cfe] unspecified +// [cfe] A value must be explicitly returned from a non-void function. } void main() { diff --git a/tests/language/invalid_returns/sync_invalid_return_06_test.dart b/tests/language/invalid_returns/sync_invalid_return_06_test.dart index e7530f178bf2..b5b41c3466ce 100644 --- a/tests/language/invalid_returns/sync_invalid_return_06_test.dart +++ b/tests/language/invalid_returns/sync_invalid_return_06_test.dart @@ -13,7 +13,7 @@ void test() { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] Can't return a value from a void function. } void main() { diff --git a/tests/language/invalid_returns/sync_invalid_return_07_test.dart b/tests/language/invalid_returns/sync_invalid_return_07_test.dart index 691cf5d6f657..6a03677388c1 100644 --- a/tests/language/invalid_returns/sync_invalid_return_07_test.dart +++ b/tests/language/invalid_returns/sync_invalid_return_07_test.dart @@ -13,7 +13,7 @@ void test() { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] Can't return a value from a void function. } void main() { diff --git a/tests/language/invalid_returns/sync_invalid_return_08_test.dart b/tests/language/invalid_returns/sync_invalid_return_08_test.dart index 94067eba047e..762714bf86d7 100644 --- a/tests/language/invalid_returns/sync_invalid_return_08_test.dart +++ b/tests/language/invalid_returns/sync_invalid_return_08_test.dart @@ -13,7 +13,7 @@ void test() { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] Can't return a value from a void function. } void main() { diff --git a/tests/language/invalid_returns/sync_invalid_return_09_test.dart b/tests/language/invalid_returns/sync_invalid_return_09_test.dart index b4bca3ea8071..b7a8981100a2 100644 --- a/tests/language/invalid_returns/sync_invalid_return_09_test.dart +++ b/tests/language/invalid_returns/sync_invalid_return_09_test.dart @@ -13,7 +13,7 @@ void test() { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] Can't return a value from a void function. } void main() { diff --git a/tests/language/invalid_returns/sync_invalid_return_10_test.dart b/tests/language/invalid_returns/sync_invalid_return_10_test.dart index 26508b347c16..f57003b652f1 100644 --- a/tests/language/invalid_returns/sync_invalid_return_10_test.dart +++ b/tests/language/invalid_returns/sync_invalid_return_10_test.dart @@ -13,7 +13,7 @@ void test() { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] Can't return a value from a void function. } void main() { diff --git a/tests/language/invalid_returns/sync_invalid_return_11_test.dart b/tests/language/invalid_returns/sync_invalid_return_11_test.dart index cfdef54f543c..2d9cf3ef5e40 100644 --- a/tests/language/invalid_returns/sync_invalid_return_11_test.dart +++ b/tests/language/invalid_returns/sync_invalid_return_11_test.dart @@ -13,7 +13,7 @@ void test() { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] Can't return a value from a void function. } void main() { diff --git a/tests/language/invalid_returns/sync_invalid_return_12_test.dart b/tests/language/invalid_returns/sync_invalid_return_12_test.dart index 23b45a4bb81e..e6ace808e29e 100644 --- a/tests/language/invalid_returns/sync_invalid_return_12_test.dart +++ b/tests/language/invalid_returns/sync_invalid_return_12_test.dart @@ -13,7 +13,7 @@ int test() { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'void' can't be returned from a function with return type 'int'. } void main() { diff --git a/tests/language/invalid_returns/sync_invalid_return_13_test.dart b/tests/language/invalid_returns/sync_invalid_return_13_test.dart index cadaa2473ad4..5abb52b856f9 100644 --- a/tests/language/invalid_returns/sync_invalid_return_13_test.dart +++ b/tests/language/invalid_returns/sync_invalid_return_13_test.dart @@ -13,7 +13,7 @@ Object? test() { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'void' can't be returned from a function with return type 'Object?'. } void main() { diff --git a/tests/language/invalid_returns/sync_invalid_return_14_test.dart b/tests/language/invalid_returns/sync_invalid_return_14_test.dart index 0082e8e6b2e4..8cd50e257693 100644 --- a/tests/language/invalid_returns/sync_invalid_return_14_test.dart +++ b/tests/language/invalid_returns/sync_invalid_return_14_test.dart @@ -13,7 +13,7 @@ Future? test() { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'void' can't be returned from a function with return type 'Future?'. } void main() { diff --git a/tests/language/invalid_returns/sync_invalid_return_15_test.dart b/tests/language/invalid_returns/sync_invalid_return_15_test.dart index 0bbb36745ee9..b58686195b7b 100644 --- a/tests/language/invalid_returns/sync_invalid_return_15_test.dart +++ b/tests/language/invalid_returns/sync_invalid_return_15_test.dart @@ -13,7 +13,7 @@ FutureOr test() { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'void' can't be returned from a function with return type 'FutureOr'. } void main() { diff --git a/tests/language/invalid_returns/sync_invalid_return_16_test.dart b/tests/language/invalid_returns/sync_invalid_return_16_test.dart index d2a2cd9c9dae..897f5a946a5a 100644 --- a/tests/language/invalid_returns/sync_invalid_return_16_test.dart +++ b/tests/language/invalid_returns/sync_invalid_return_16_test.dart @@ -13,7 +13,7 @@ Future? test() { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'void' can't be returned from a function with return type 'Future?'. } void main() { diff --git a/tests/language/invalid_returns/sync_invalid_return_17_test.dart b/tests/language/invalid_returns/sync_invalid_return_17_test.dart index 4834cd628ed4..493faf0439a3 100644 --- a/tests/language/invalid_returns/sync_invalid_return_17_test.dart +++ b/tests/language/invalid_returns/sync_invalid_return_17_test.dart @@ -13,7 +13,7 @@ FutureOr test() { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'void' can't be returned from a function with return type 'FutureOr'. } void main() { diff --git a/tests/language/invalid_returns/sync_invalid_return_18_test.dart b/tests/language/invalid_returns/sync_invalid_return_18_test.dart index 24abec06ee77..de1f9a23b017 100644 --- a/tests/language/invalid_returns/sync_invalid_return_18_test.dart +++ b/tests/language/invalid_returns/sync_invalid_return_18_test.dart @@ -13,7 +13,7 @@ String test() { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'int' can't be returned from a function with return type 'String'. } void main() { diff --git a/tests/language/invalid_returns/sync_invalid_return_19_test.dart b/tests/language/invalid_returns/sync_invalid_return_19_test.dart index 7e0d3df94312..613cadc56369 100644 --- a/tests/language/invalid_returns/sync_invalid_return_19_test.dart +++ b/tests/language/invalid_returns/sync_invalid_return_19_test.dart @@ -13,7 +13,7 @@ String test() { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'Future' can't be returned from a function with return type 'String'. } void main() { diff --git a/tests/language/invalid_returns/sync_invalid_return_20_test.dart b/tests/language/invalid_returns/sync_invalid_return_20_test.dart index a057f8f3d2f8..928168cd3fa6 100644 --- a/tests/language/invalid_returns/sync_invalid_return_20_test.dart +++ b/tests/language/invalid_returns/sync_invalid_return_20_test.dart @@ -13,7 +13,7 @@ String test() { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'FutureOr' can't be returned from a function with return type 'String'. } void main() { diff --git a/tests/language/invalid_returns/sync_invalid_return_21_test.dart b/tests/language/invalid_returns/sync_invalid_return_21_test.dart index 140508e746bf..fc1c898f5f10 100644 --- a/tests/language/invalid_returns/sync_invalid_return_21_test.dart +++ b/tests/language/invalid_returns/sync_invalid_return_21_test.dart @@ -13,7 +13,7 @@ Future test() { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'int' can't be returned from a function with return type 'Future'. } void main() { diff --git a/tests/language/invalid_returns/sync_invalid_return_22_test.dart b/tests/language/invalid_returns/sync_invalid_return_22_test.dart index b1e2dc7a7959..47a2401f5eaf 100644 --- a/tests/language/invalid_returns/sync_invalid_return_22_test.dart +++ b/tests/language/invalid_returns/sync_invalid_return_22_test.dart @@ -13,7 +13,7 @@ Future test() { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'Future' can't be returned from a function with return type 'Future'. } void main() { diff --git a/tests/language/invalid_returns/sync_invalid_return_23_test.dart b/tests/language/invalid_returns/sync_invalid_return_23_test.dart index 2b9a8334bf42..a9d4ab767e78 100644 --- a/tests/language/invalid_returns/sync_invalid_return_23_test.dart +++ b/tests/language/invalid_returns/sync_invalid_return_23_test.dart @@ -13,7 +13,7 @@ Future test() { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'FutureOr' can't be returned from a function with return type 'Future'. } void main() { diff --git a/tests/language/invalid_returns/sync_invalid_return_24_test.dart b/tests/language/invalid_returns/sync_invalid_return_24_test.dart index 5606fd47943d..cbc5b15e8f45 100644 --- a/tests/language/invalid_returns/sync_invalid_return_24_test.dart +++ b/tests/language/invalid_returns/sync_invalid_return_24_test.dart @@ -13,7 +13,7 @@ FutureOr test() { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'int' can't be returned from a function with return type 'FutureOr'. } void main() { diff --git a/tests/language/invalid_returns/sync_invalid_return_25_test.dart b/tests/language/invalid_returns/sync_invalid_return_25_test.dart index 90014c97706e..ac9c262cada8 100644 --- a/tests/language/invalid_returns/sync_invalid_return_25_test.dart +++ b/tests/language/invalid_returns/sync_invalid_return_25_test.dart @@ -13,7 +13,7 @@ FutureOr test() { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'Future' can't be returned from a function with return type 'FutureOr'. } void main() { diff --git a/tests/language/invalid_returns/sync_invalid_return_26_test.dart b/tests/language/invalid_returns/sync_invalid_return_26_test.dart index 1ea644f24ec4..ec1ff2ea7ec4 100644 --- a/tests/language/invalid_returns/sync_invalid_return_26_test.dart +++ b/tests/language/invalid_returns/sync_invalid_return_26_test.dart @@ -13,7 +13,7 @@ FutureOr test() { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'FutureOr' can't be returned from a function with return type 'FutureOr'. } void main() { diff --git a/tests/language/invalid_returns/sync_invalid_return_27_test.dart b/tests/language/invalid_returns/sync_invalid_return_27_test.dart index 0361ee28400f..d3d6999bf604 100644 --- a/tests/language/invalid_returns/sync_invalid_return_27_test.dart +++ b/tests/language/invalid_returns/sync_invalid_return_27_test.dart @@ -14,7 +14,7 @@ Null test() { return v; // ^ // [analyzer] unspecified - // [cfe] unspecified + // [cfe] A value of type 'void' can't be returned from a function with return type 'Null'. } void main() {