[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 <johnniwinther@google.com> Reviewed-by: Erik Ernst <eernst@google.com>
This commit is contained in:
committed by
commit-bot@chromium.org
parent
9ab7a5edef
commit
fd432febe0
@@ -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<Object> typeParts = labeler.labelType(_type);
|
||||
List<Object> 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<Object> typeParts = labeler.labelType(_type);
|
||||
List<Object> 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,
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<Message Function(DartType, DartType, bool)> 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<Message Function(DartType, DartType, bool)> 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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -3413,6 +3413,16 @@ ReturnWithoutExpressionAsync:
|
||||
configuration: nnbd-strong
|
||||
declaration: "Future<int> 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<int> 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
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
class Class {
|
||||
@override
|
||||
noSuchMethod(Object o, {String foo = ''}) => 42;
|
||||
@override
|
||||
toString({String foo = ''}) => 'foo';
|
||||
}
|
||||
|
||||
main() {}
|
||||
test() {}
|
||||
@@ -0,0 +1,9 @@
|
||||
class Class {
|
||||
@override
|
||||
noSuchMethod(Object o, {String foo = ''}) => 42;
|
||||
@override
|
||||
toString({String foo = ''}) => 'foo';
|
||||
}
|
||||
|
||||
main() {}
|
||||
test() {}
|
||||
@@ -0,0 +1,3 @@
|
||||
bool Function(T) predicate<T>(bool Function(T) fn) => (T val) => fn(val);
|
||||
void test() {}
|
||||
void main() {}
|
||||
@@ -0,0 +1,3 @@
|
||||
bool Function(T) predicate<T>(bool Function(T) fn) => (T val) => fn(val);
|
||||
void main() {}
|
||||
void test() {}
|
||||
@@ -0,0 +1,2 @@
|
||||
void test() {}
|
||||
main() {}
|
||||
@@ -0,0 +1,2 @@
|
||||
main() {}
|
||||
void test() {}
|
||||
@@ -2,12 +2,12 @@ library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'Future<bool>'.
|
||||
// pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future<dynamic>' can't be returned from a function with return type 'Future<bool>'.
|
||||
// - 'Future' is from 'dart:async'.
|
||||
// Future<bool> test5() => getFutureNull(); // error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'Future<bool>'.
|
||||
// pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future<dynamic>' can't be returned from a function with return type 'Future<bool>'.
|
||||
// - 'Future' is from 'dart:async'.
|
||||
// Future<bool> test5() => getFutureNull(); // error
|
||||
// ^
|
||||
@@ -48,7 +48,7 @@ static method test3() → core::bool
|
||||
static method test4() → asy::Future<core::bool> async
|
||||
return await self::getFutureNull() as{TypeError,ForDynamic,ForNonNullableByDefault} FutureOr<core::bool>;
|
||||
static method test5() → asy::Future<core::bool>
|
||||
return let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'Future<bool>'.
|
||||
return let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future<dynamic>' can't be returned from a function with return type 'Future<bool>'.
|
||||
- 'Future' is from 'dart:async'.
|
||||
Future<bool> test5() => getFutureNull(); // error
|
||||
^" in self::getFutureNull() as{TypeError,ForNonNullableByDefault} asy::Future<core::bool>;
|
||||
@@ -66,7 +66,7 @@ static method test() → dynamic async {
|
||||
function test4() → asy::Future<core::bool> async
|
||||
return await self::getFutureNull() as{TypeError,ForDynamic,ForNonNullableByDefault} FutureOr<core::bool>;
|
||||
function test5() → asy::Future<core::bool>
|
||||
return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'Future<bool>'.
|
||||
return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future<dynamic>' can't be returned from a function with return type 'Future<bool>'.
|
||||
- 'Future' is from 'dart:async'.
|
||||
Future<bool> test5() => getFutureNull(); // error
|
||||
^" in self::getFutureNull() as{TypeError,ForNonNullableByDefault} asy::Future<core::bool>;
|
||||
|
||||
@@ -2,12 +2,12 @@ library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'Future<bool>'.
|
||||
// pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future<dynamic>' can't be returned from a function with return type 'Future<bool>'.
|
||||
// - 'Future' is from 'dart:async'.
|
||||
// Future<bool> test5() => getFutureNull(); // error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'Future<bool>'.
|
||||
// pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future<dynamic>' can't be returned from a function with return type 'Future<bool>'.
|
||||
// - 'Future' is from 'dart:async'.
|
||||
// Future<bool> test5() => getFutureNull(); // error
|
||||
// ^
|
||||
@@ -150,7 +150,7 @@ static method test4() → asy::Future<core::bool> /* originally async */ {
|
||||
return :async_completer.{asy::Completer::future};
|
||||
}
|
||||
static method test5() → asy::Future<core::bool>
|
||||
return let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'Future<bool>'.
|
||||
return let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future<dynamic>' can't be returned from a function with return type 'Future<bool>'.
|
||||
- 'Future' is from 'dart:async'.
|
||||
Future<bool> test5() => getFutureNull(); // error
|
||||
^" in self::getFutureNull() as{TypeError,ForNonNullableByDefault} asy::Future<core::bool>;
|
||||
@@ -258,7 +258,7 @@ static method test() → dynamic /* originally async */ {
|
||||
return :async_completer.{asy::Completer::future};
|
||||
}
|
||||
function test5() → asy::Future<core::bool>
|
||||
return let final<BottomType> #t6 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'Future<bool>'.
|
||||
return let final<BottomType> #t6 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future<dynamic>' can't be returned from a function with return type 'Future<bool>'.
|
||||
- 'Future' is from 'dart:async'.
|
||||
Future<bool> test5() => getFutureNull(); // error
|
||||
^" in self::getFutureNull() as{TypeError,ForNonNullableByDefault} asy::Future<core::bool>;
|
||||
|
||||
@@ -2,12 +2,12 @@ library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'Future<bool>'.
|
||||
// pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future<dynamic>' can't be returned from a function with return type 'Future<bool>'.
|
||||
// - 'Future' is from 'dart:async'.
|
||||
// Future<bool> test5() => getFutureNull(); // error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'Future<bool>'.
|
||||
// pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future<dynamic>' can't be returned from a function with return type 'Future<bool>'.
|
||||
// - 'Future' is from 'dart:async'.
|
||||
// Future<bool> test5() => getFutureNull(); // error
|
||||
// ^
|
||||
@@ -48,7 +48,7 @@ static method test3() → core::bool
|
||||
static method test4() → asy::Future<core::bool> async
|
||||
return await self::getFutureNull() as{TypeError,ForDynamic,ForNonNullableByDefault} FutureOr<core::bool>;
|
||||
static method test5() → asy::Future<core::bool>
|
||||
return let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'Future<bool>'.
|
||||
return let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future<dynamic>' can't be returned from a function with return type 'Future<bool>'.
|
||||
- 'Future' is from 'dart:async'.
|
||||
Future<bool> test5() => getFutureNull(); // error
|
||||
^" in self::getFutureNull() as{TypeError,ForNonNullableByDefault} asy::Future<core::bool>;
|
||||
@@ -66,7 +66,7 @@ static method test() → dynamic async {
|
||||
function test4() → asy::Future<core::bool> async
|
||||
return await self::getFutureNull() as{TypeError,ForDynamic,ForNonNullableByDefault} FutureOr<core::bool>;
|
||||
function test5() → asy::Future<core::bool>
|
||||
return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'Future<bool>'.
|
||||
return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future<dynamic>' can't be returned from a function with return type 'Future<bool>'.
|
||||
- 'Future' is from 'dart:async'.
|
||||
Future<bool> test5() => getFutureNull(); // error
|
||||
^" in self::getFutureNull() as{TypeError,ForNonNullableByDefault} asy::Future<core::bool>;
|
||||
|
||||
@@ -2,12 +2,12 @@ library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'Future<bool>'.
|
||||
// pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future<dynamic>' can't be returned from a function with return type 'Future<bool>'.
|
||||
// - 'Future' is from 'dart:async'.
|
||||
// Future<bool> test5() => getFutureNull(); // error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'Future<bool>'.
|
||||
// pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future<dynamic>' can't be returned from a function with return type 'Future<bool>'.
|
||||
// - 'Future' is from 'dart:async'.
|
||||
// Future<bool> test5() => getFutureNull(); // error
|
||||
// ^
|
||||
@@ -150,7 +150,7 @@ static method test4() → asy::Future<core::bool> /* originally async */ {
|
||||
return :async_completer.{asy::Completer::future};
|
||||
}
|
||||
static method test5() → asy::Future<core::bool>
|
||||
return let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'Future<bool>'.
|
||||
return let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future<dynamic>' can't be returned from a function with return type 'Future<bool>'.
|
||||
- 'Future' is from 'dart:async'.
|
||||
Future<bool> test5() => getFutureNull(); // error
|
||||
^" in self::getFutureNull() as{TypeError,ForNonNullableByDefault} asy::Future<core::bool>;
|
||||
@@ -258,7 +258,7 @@ static method test() → dynamic /* originally async */ {
|
||||
return :async_completer.{asy::Completer::future};
|
||||
}
|
||||
function test5() → asy::Future<core::bool>
|
||||
return let final<BottomType> #t6 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'Future<bool>'.
|
||||
return let final<BottomType> #t6 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future<dynamic>' can't be returned from a function with return type 'Future<bool>'.
|
||||
- 'Future' is from 'dart:async'.
|
||||
Future<bool> test5() => getFutureNull(); // error
|
||||
^" in self::getFutureNull() as{TypeError,ForNonNullableByDefault} asy::Future<core::bool>;
|
||||
|
||||
@@ -7,7 +7,7 @@ library /*isNonNullableByDefault*/;
|
||||
// yield* getIterableNull(); // error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable<dynamic>' can't be assigned to a variable of type 'Iterable<bool>'.
|
||||
// pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable<dynamic>' can't be returned from a function with return type 'Iterable<bool>'.
|
||||
// - 'Iterable' is from 'dart:core'.
|
||||
// Iterable<bool> 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<dynamic>' can't be assigned to a variable of type 'Iterable<bool>'.
|
||||
// pkg/front_end/testcases/nnbd/issue41437b.dart:41:29: Error: A value of type 'Iterable<dynamic>' can't be returned from a function with return type 'Iterable<bool>'.
|
||||
// - 'Iterable' is from 'dart:core'.
|
||||
// Iterable<bool> test5() => getIterableNull(); // error
|
||||
// ^
|
||||
@@ -62,7 +62,7 @@ static method test4() → core::Iterable<core::bool> sync* {
|
||||
^" in self::getIterableNull() as{TypeError,ForNonNullableByDefault} core::Iterable<core::bool>;
|
||||
}
|
||||
static method test5() → core::Iterable<core::bool>
|
||||
return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable<dynamic>' can't be assigned to a variable of type 'Iterable<bool>'.
|
||||
return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable<dynamic>' can't be returned from a function with return type 'Iterable<bool>'.
|
||||
- 'Iterable' is from 'dart:core'.
|
||||
Iterable<bool> test5() => getIterableNull(); // error
|
||||
^" in self::getIterableNull() as{TypeError,ForNonNullableByDefault} core::Iterable<core::bool>;
|
||||
@@ -86,7 +86,7 @@ static method test() → dynamic async {
|
||||
^" in self::getIterableNull() as{TypeError,ForNonNullableByDefault} core::Iterable<core::bool>;
|
||||
}
|
||||
function test5() → core::Iterable<core::bool>
|
||||
return let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:41:29: Error: A value of type 'Iterable<dynamic>' can't be assigned to a variable of type 'Iterable<bool>'.
|
||||
return let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:41:29: Error: A value of type 'Iterable<dynamic>' can't be returned from a function with return type 'Iterable<bool>'.
|
||||
- 'Iterable' is from 'dart:core'.
|
||||
Iterable<bool> test5() => getIterableNull(); // error
|
||||
^" in self::getIterableNull() as{TypeError,ForNonNullableByDefault} core::Iterable<core::bool>;
|
||||
|
||||
@@ -7,7 +7,7 @@ library /*isNonNullableByDefault*/;
|
||||
// yield* getIterableNull(); // error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable<dynamic>' can't be assigned to a variable of type 'Iterable<bool>'.
|
||||
// pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable<dynamic>' can't be returned from a function with return type 'Iterable<bool>'.
|
||||
// - 'Iterable' is from 'dart:core'.
|
||||
// Iterable<bool> 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<dynamic>' can't be assigned to a variable of type 'Iterable<bool>'.
|
||||
// pkg/front_end/testcases/nnbd/issue41437b.dart:41:29: Error: A value of type 'Iterable<dynamic>' can't be returned from a function with return type 'Iterable<bool>'.
|
||||
// - 'Iterable' is from 'dart:core'.
|
||||
// Iterable<bool> test5() => getIterableNull(); // error
|
||||
// ^
|
||||
@@ -115,7 +115,7 @@ static method test4() → core::Iterable<core::bool> /* originally sync* */ {
|
||||
return new core::_SyncIterable::•<core::bool>(:sync_op_gen);
|
||||
}
|
||||
static method test5() → core::Iterable<core::bool>
|
||||
return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable<dynamic>' can't be assigned to a variable of type 'Iterable<bool>'.
|
||||
return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable<dynamic>' can't be returned from a function with return type 'Iterable<bool>'.
|
||||
- 'Iterable' is from 'dart:core'.
|
||||
Iterable<bool> test5() => getIterableNull(); // error
|
||||
^" in self::getIterableNull() as{TypeError,ForNonNullableByDefault} core::Iterable<core::bool>;
|
||||
@@ -189,7 +189,7 @@ static method test() → dynamic /* originally async */ {
|
||||
return new core::_SyncIterable::•<core::bool>(:sync_op_gen);
|
||||
}
|
||||
function test5() → core::Iterable<core::bool>
|
||||
return let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:41:29: Error: A value of type 'Iterable<dynamic>' can't be assigned to a variable of type 'Iterable<bool>'.
|
||||
return let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:41:29: Error: A value of type 'Iterable<dynamic>' can't be returned from a function with return type 'Iterable<bool>'.
|
||||
- 'Iterable' is from 'dart:core'.
|
||||
Iterable<bool> test5() => getIterableNull(); // error
|
||||
^" in self::getIterableNull() as{TypeError,ForNonNullableByDefault} core::Iterable<core::bool>;
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
dynamic getNull() => null;
|
||||
Iterable<dynamic> getIterableNull() sync* {}
|
||||
Iterable<bool> getIterableBool() sync* {}
|
||||
Iterable<bool> test1() sync* {}
|
||||
Iterable<bool> test2() => getNull();
|
||||
bool test3() => getNull();
|
||||
Iterable<bool> test4() sync* {}
|
||||
Iterable<bool> test5() => getIterableNull();
|
||||
Iterable<bool> test6() => getIterableBool();
|
||||
Iterable<bool> test7() sync* {}
|
||||
test() async {}
|
||||
main() {}
|
||||
@@ -0,0 +1,12 @@
|
||||
Iterable<bool> getIterableBool() sync* {}
|
||||
Iterable<bool> test1() sync* {}
|
||||
Iterable<bool> test2() => getNull();
|
||||
Iterable<bool> test4() sync* {}
|
||||
Iterable<bool> test5() => getIterableNull();
|
||||
Iterable<bool> test6() => getIterableBool();
|
||||
Iterable<bool> test7() sync* {}
|
||||
Iterable<dynamic> getIterableNull() sync* {}
|
||||
bool test3() => getNull();
|
||||
dynamic getNull() => null;
|
||||
main() {}
|
||||
test() async {}
|
||||
@@ -7,7 +7,7 @@ library /*isNonNullableByDefault*/;
|
||||
// yield* getIterableNull(); // error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable<dynamic>' can't be assigned to a variable of type 'Iterable<bool>'.
|
||||
// pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable<dynamic>' can't be returned from a function with return type 'Iterable<bool>'.
|
||||
// - 'Iterable' is from 'dart:core'.
|
||||
// Iterable<bool> 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<dynamic>' can't be assigned to a variable of type 'Iterable<bool>'.
|
||||
// pkg/front_end/testcases/nnbd/issue41437b.dart:41:29: Error: A value of type 'Iterable<dynamic>' can't be returned from a function with return type 'Iterable<bool>'.
|
||||
// - 'Iterable' is from 'dart:core'.
|
||||
// Iterable<bool> test5() => getIterableNull(); // error
|
||||
// ^
|
||||
@@ -62,7 +62,7 @@ static method test4() → core::Iterable<core::bool> sync* {
|
||||
^" in self::getIterableNull() as{TypeError,ForNonNullableByDefault} core::Iterable<core::bool>;
|
||||
}
|
||||
static method test5() → core::Iterable<core::bool>
|
||||
return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable<dynamic>' can't be assigned to a variable of type 'Iterable<bool>'.
|
||||
return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable<dynamic>' can't be returned from a function with return type 'Iterable<bool>'.
|
||||
- 'Iterable' is from 'dart:core'.
|
||||
Iterable<bool> test5() => getIterableNull(); // error
|
||||
^" in self::getIterableNull() as{TypeError,ForNonNullableByDefault} core::Iterable<core::bool>;
|
||||
@@ -86,7 +86,7 @@ static method test() → dynamic async {
|
||||
^" in self::getIterableNull() as{TypeError,ForNonNullableByDefault} core::Iterable<core::bool>;
|
||||
}
|
||||
function test5() → core::Iterable<core::bool>
|
||||
return let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:41:29: Error: A value of type 'Iterable<dynamic>' can't be assigned to a variable of type 'Iterable<bool>'.
|
||||
return let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:41:29: Error: A value of type 'Iterable<dynamic>' can't be returned from a function with return type 'Iterable<bool>'.
|
||||
- 'Iterable' is from 'dart:core'.
|
||||
Iterable<bool> test5() => getIterableNull(); // error
|
||||
^" in self::getIterableNull() as{TypeError,ForNonNullableByDefault} core::Iterable<core::bool>;
|
||||
|
||||
@@ -7,7 +7,7 @@ library /*isNonNullableByDefault*/;
|
||||
// yield* getIterableNull(); // error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable<dynamic>' can't be assigned to a variable of type 'Iterable<bool>'.
|
||||
// pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable<dynamic>' can't be returned from a function with return type 'Iterable<bool>'.
|
||||
// - 'Iterable' is from 'dart:core'.
|
||||
// Iterable<bool> 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<dynamic>' can't be assigned to a variable of type 'Iterable<bool>'.
|
||||
// pkg/front_end/testcases/nnbd/issue41437b.dart:41:29: Error: A value of type 'Iterable<dynamic>' can't be returned from a function with return type 'Iterable<bool>'.
|
||||
// - 'Iterable' is from 'dart:core'.
|
||||
// Iterable<bool> test5() => getIterableNull(); // error
|
||||
// ^
|
||||
@@ -115,7 +115,7 @@ static method test4() → core::Iterable<core::bool> /* originally sync* */ {
|
||||
return new core::_SyncIterable::•<core::bool>(:sync_op_gen);
|
||||
}
|
||||
static method test5() → core::Iterable<core::bool>
|
||||
return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable<dynamic>' can't be assigned to a variable of type 'Iterable<bool>'.
|
||||
return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable<dynamic>' can't be returned from a function with return type 'Iterable<bool>'.
|
||||
- 'Iterable' is from 'dart:core'.
|
||||
Iterable<bool> test5() => getIterableNull(); // error
|
||||
^" in self::getIterableNull() as{TypeError,ForNonNullableByDefault} core::Iterable<core::bool>;
|
||||
@@ -189,7 +189,7 @@ static method test() → dynamic /* originally async */ {
|
||||
return new core::_SyncIterable::•<core::bool>(:sync_op_gen);
|
||||
}
|
||||
function test5() → core::Iterable<core::bool>
|
||||
return let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:41:29: Error: A value of type 'Iterable<dynamic>' can't be assigned to a variable of type 'Iterable<bool>'.
|
||||
return let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:41:29: Error: A value of type 'Iterable<dynamic>' can't be returned from a function with return type 'Iterable<bool>'.
|
||||
- 'Iterable' is from 'dart:core'.
|
||||
Iterable<bool> test5() => getIterableNull(); // error
|
||||
^" in self::getIterableNull() as{TypeError,ForNonNullableByDefault} core::Iterable<core::bool>;
|
||||
|
||||
@@ -7,7 +7,7 @@ library /*isNonNullableByDefault*/;
|
||||
// yield* getStreamNull(); // error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/nnbd/issue41437c.dart:24:25: Error: A value of type 'Stream<dynamic>' can't be assigned to a variable of type 'Stream<bool>'.
|
||||
// pkg/front_end/testcases/nnbd/issue41437c.dart:24:25: Error: A value of type 'Stream<dynamic>' can't be returned from a function with return type 'Stream<bool>'.
|
||||
// - 'Stream' is from 'dart:async'.
|
||||
// Stream<bool> 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<dynamic>' can't be assigned to a variable of type 'Stream<bool>'.
|
||||
// pkg/front_end/testcases/nnbd/issue41437c.dart:41:27: Error: A value of type 'Stream<dynamic>' can't be returned from a function with return type 'Stream<bool>'.
|
||||
// - 'Stream' is from 'dart:async'.
|
||||
// Stream<bool> test5() => getStreamNull(); // error
|
||||
// ^
|
||||
@@ -63,7 +63,7 @@ static method test4() → asy::Stream<core::bool> async* {
|
||||
^" in self::getStreamNull() as{TypeError,ForNonNullableByDefault} asy::Stream<core::bool>;
|
||||
}
|
||||
static method test5() → asy::Stream<core::bool>
|
||||
return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437c.dart:24:25: Error: A value of type 'Stream<dynamic>' can't be assigned to a variable of type 'Stream<bool>'.
|
||||
return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437c.dart:24:25: Error: A value of type 'Stream<dynamic>' can't be returned from a function with return type 'Stream<bool>'.
|
||||
- 'Stream' is from 'dart:async'.
|
||||
Stream<bool> test5() => getStreamNull(); // error
|
||||
^" in self::getStreamNull() as{TypeError,ForNonNullableByDefault} asy::Stream<core::bool>;
|
||||
@@ -87,7 +87,7 @@ static method test() → dynamic async {
|
||||
^" in self::getStreamNull() as{TypeError,ForNonNullableByDefault} asy::Stream<core::bool>;
|
||||
}
|
||||
function test5() → asy::Stream<core::bool>
|
||||
return let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437c.dart:41:27: Error: A value of type 'Stream<dynamic>' can't be assigned to a variable of type 'Stream<bool>'.
|
||||
return let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437c.dart:41:27: Error: A value of type 'Stream<dynamic>' can't be returned from a function with return type 'Stream<bool>'.
|
||||
- 'Stream' is from 'dart:async'.
|
||||
Stream<bool> test5() => getStreamNull(); // error
|
||||
^" in self::getStreamNull() as{TypeError,ForNonNullableByDefault} asy::Stream<core::bool>;
|
||||
|
||||
@@ -7,7 +7,7 @@ library /*isNonNullableByDefault*/;
|
||||
// yield* getStreamNull(); // error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/nnbd/issue41437c.dart:24:25: Error: A value of type 'Stream<dynamic>' can't be assigned to a variable of type 'Stream<bool>'.
|
||||
// pkg/front_end/testcases/nnbd/issue41437c.dart:24:25: Error: A value of type 'Stream<dynamic>' can't be returned from a function with return type 'Stream<bool>'.
|
||||
// - 'Stream' is from 'dart:async'.
|
||||
// Stream<bool> 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<dynamic>' can't be assigned to a variable of type 'Stream<bool>'.
|
||||
// pkg/front_end/testcases/nnbd/issue41437c.dart:41:27: Error: A value of type 'Stream<dynamic>' can't be returned from a function with return type 'Stream<bool>'.
|
||||
// - 'Stream' is from 'dart:async'.
|
||||
// Stream<bool> test5() => getStreamNull(); // error
|
||||
// ^
|
||||
@@ -191,7 +191,7 @@ static method test4() → asy::Stream<core::bool> /* originally async* */ {
|
||||
return :controller_stream;
|
||||
}
|
||||
static method test5() → asy::Stream<core::bool>
|
||||
return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437c.dart:24:25: Error: A value of type 'Stream<dynamic>' can't be assigned to a variable of type 'Stream<bool>'.
|
||||
return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437c.dart:24:25: Error: A value of type 'Stream<dynamic>' can't be returned from a function with return type 'Stream<bool>'.
|
||||
- 'Stream' is from 'dart:async'.
|
||||
Stream<bool> test5() => getStreamNull(); // error
|
||||
^" in self::getStreamNull() as{TypeError,ForNonNullableByDefault} asy::Stream<core::bool>;
|
||||
@@ -322,7 +322,7 @@ static method test() → dynamic /* originally async */ {
|
||||
return :controller_stream;
|
||||
}
|
||||
function test5() → asy::Stream<core::bool>
|
||||
return let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437c.dart:41:27: Error: A value of type 'Stream<dynamic>' can't be assigned to a variable of type 'Stream<bool>'.
|
||||
return let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437c.dart:41:27: Error: A value of type 'Stream<dynamic>' can't be returned from a function with return type 'Stream<bool>'.
|
||||
- 'Stream' is from 'dart:async'.
|
||||
Stream<bool> test5() => getStreamNull(); // error
|
||||
^" in self::getStreamNull() as{TypeError,ForNonNullableByDefault} asy::Stream<core::bool>;
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
dynamic getNull() => null;
|
||||
Stream<dynamic> getStreamNull() async* {}
|
||||
Stream<bool> getStreamBool() async* {}
|
||||
Stream<bool> test1() async* {}
|
||||
Stream<bool> test2() => getNull();
|
||||
bool test3() => getNull();
|
||||
Stream<bool> test4() async* {}
|
||||
Stream<bool> test5() => getStreamNull();
|
||||
Stream<bool> test6() => getStreamBool();
|
||||
Stream<bool> test7() async* {}
|
||||
test() async {}
|
||||
main() {}
|
||||
@@ -0,0 +1,12 @@
|
||||
Stream<bool> getStreamBool() async* {}
|
||||
Stream<bool> test1() async* {}
|
||||
Stream<bool> test2() => getNull();
|
||||
Stream<bool> test4() async* {}
|
||||
Stream<bool> test5() => getStreamNull();
|
||||
Stream<bool> test6() => getStreamBool();
|
||||
Stream<bool> test7() async* {}
|
||||
Stream<dynamic> getStreamNull() async* {}
|
||||
bool test3() => getNull();
|
||||
dynamic getNull() => null;
|
||||
main() {}
|
||||
test() async {}
|
||||
@@ -7,7 +7,7 @@ library /*isNonNullableByDefault*/;
|
||||
// yield* getStreamNull(); // error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/nnbd/issue41437c.dart:24:25: Error: A value of type 'Stream<dynamic>' can't be assigned to a variable of type 'Stream<bool>'.
|
||||
// pkg/front_end/testcases/nnbd/issue41437c.dart:24:25: Error: A value of type 'Stream<dynamic>' can't be returned from a function with return type 'Stream<bool>'.
|
||||
// - 'Stream' is from 'dart:async'.
|
||||
// Stream<bool> 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<dynamic>' can't be assigned to a variable of type 'Stream<bool>'.
|
||||
// pkg/front_end/testcases/nnbd/issue41437c.dart:41:27: Error: A value of type 'Stream<dynamic>' can't be returned from a function with return type 'Stream<bool>'.
|
||||
// - 'Stream' is from 'dart:async'.
|
||||
// Stream<bool> test5() => getStreamNull(); // error
|
||||
// ^
|
||||
@@ -63,7 +63,7 @@ static method test4() → asy::Stream<core::bool> async* {
|
||||
^" in self::getStreamNull() as{TypeError,ForNonNullableByDefault} asy::Stream<core::bool>;
|
||||
}
|
||||
static method test5() → asy::Stream<core::bool>
|
||||
return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437c.dart:24:25: Error: A value of type 'Stream<dynamic>' can't be assigned to a variable of type 'Stream<bool>'.
|
||||
return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437c.dart:24:25: Error: A value of type 'Stream<dynamic>' can't be returned from a function with return type 'Stream<bool>'.
|
||||
- 'Stream' is from 'dart:async'.
|
||||
Stream<bool> test5() => getStreamNull(); // error
|
||||
^" in self::getStreamNull() as{TypeError,ForNonNullableByDefault} asy::Stream<core::bool>;
|
||||
@@ -87,7 +87,7 @@ static method test() → dynamic async {
|
||||
^" in self::getStreamNull() as{TypeError,ForNonNullableByDefault} asy::Stream<core::bool>;
|
||||
}
|
||||
function test5() → asy::Stream<core::bool>
|
||||
return let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437c.dart:41:27: Error: A value of type 'Stream<dynamic>' can't be assigned to a variable of type 'Stream<bool>'.
|
||||
return let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437c.dart:41:27: Error: A value of type 'Stream<dynamic>' can't be returned from a function with return type 'Stream<bool>'.
|
||||
- 'Stream' is from 'dart:async'.
|
||||
Stream<bool> test5() => getStreamNull(); // error
|
||||
^" in self::getStreamNull() as{TypeError,ForNonNullableByDefault} asy::Stream<core::bool>;
|
||||
|
||||
@@ -7,7 +7,7 @@ library /*isNonNullableByDefault*/;
|
||||
// yield* getStreamNull(); // error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/nnbd/issue41437c.dart:24:25: Error: A value of type 'Stream<dynamic>' can't be assigned to a variable of type 'Stream<bool>'.
|
||||
// pkg/front_end/testcases/nnbd/issue41437c.dart:24:25: Error: A value of type 'Stream<dynamic>' can't be returned from a function with return type 'Stream<bool>'.
|
||||
// - 'Stream' is from 'dart:async'.
|
||||
// Stream<bool> 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<dynamic>' can't be assigned to a variable of type 'Stream<bool>'.
|
||||
// pkg/front_end/testcases/nnbd/issue41437c.dart:41:27: Error: A value of type 'Stream<dynamic>' can't be returned from a function with return type 'Stream<bool>'.
|
||||
// - 'Stream' is from 'dart:async'.
|
||||
// Stream<bool> test5() => getStreamNull(); // error
|
||||
// ^
|
||||
@@ -191,7 +191,7 @@ static method test4() → asy::Stream<core::bool> /* originally async* */ {
|
||||
return :controller_stream;
|
||||
}
|
||||
static method test5() → asy::Stream<core::bool>
|
||||
return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437c.dart:24:25: Error: A value of type 'Stream<dynamic>' can't be assigned to a variable of type 'Stream<bool>'.
|
||||
return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437c.dart:24:25: Error: A value of type 'Stream<dynamic>' can't be returned from a function with return type 'Stream<bool>'.
|
||||
- 'Stream' is from 'dart:async'.
|
||||
Stream<bool> test5() => getStreamNull(); // error
|
||||
^" in self::getStreamNull() as{TypeError,ForNonNullableByDefault} asy::Stream<core::bool>;
|
||||
@@ -322,7 +322,7 @@ static method test() → dynamic /* originally async */ {
|
||||
return :controller_stream;
|
||||
}
|
||||
function test5() → asy::Stream<core::bool>
|
||||
return let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437c.dart:41:27: Error: A value of type 'Stream<dynamic>' can't be assigned to a variable of type 'Stream<bool>'.
|
||||
return let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437c.dart:41:27: Error: A value of type 'Stream<dynamic>' can't be returned from a function with return type 'Stream<bool>'.
|
||||
- 'Stream' is from 'dart:async'.
|
||||
Stream<bool> test5() => getStreamNull(); // error
|
||||
^" in self::getStreamNull() as{TypeError,ForNonNullableByDefault} asy::Stream<core::bool>;
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
void errors() {}
|
||||
void _takesObject(Object o) {}
|
||||
void _takesStackTrace(StackTrace o) {}
|
||||
void main() {}
|
||||
@@ -0,0 +1,4 @@
|
||||
void _takesObject(Object o) {}
|
||||
void _takesStackTrace(StackTrace o) {}
|
||||
void errors() {}
|
||||
void main() {}
|
||||
@@ -0,0 +1,2 @@
|
||||
test() {}
|
||||
main() {}
|
||||
@@ -0,0 +1,2 @@
|
||||
main() {}
|
||||
test() {}
|
||||
@@ -0,0 +1,4 @@
|
||||
class Null {}
|
||||
|
||||
test() {}
|
||||
main() {}
|
||||
@@ -0,0 +1,4 @@
|
||||
class Null {}
|
||||
|
||||
main() {}
|
||||
test() {}
|
||||
@@ -0,0 +1,6 @@
|
||||
propertyGet(Never never) {}
|
||||
propertySet(Never never) {}
|
||||
methodInvocation(Never never, Invocation invocation) {}
|
||||
equals(Never never) {}
|
||||
operator(Never never) {}
|
||||
main() {}
|
||||
@@ -0,0 +1,6 @@
|
||||
equals(Never never) {}
|
||||
main() {}
|
||||
methodInvocation(Never never, Invocation invocation) {}
|
||||
operator(Never never) {}
|
||||
propertyGet(Never never) {}
|
||||
propertySet(Never never) {}
|
||||
@@ -0,0 +1,2 @@
|
||||
test(Never nonNullableNever, Never? nullableNever) {}
|
||||
main() {}
|
||||
@@ -0,0 +1,2 @@
|
||||
main() {}
|
||||
test(Never nonNullableNever, Never? nullableNever) {}
|
||||
@@ -0,0 +1,6 @@
|
||||
class A<T> {
|
||||
T? _current;
|
||||
T get current => _current as T;
|
||||
}
|
||||
|
||||
main() {}
|
||||
@@ -0,0 +1,6 @@
|
||||
class A<T> {
|
||||
T get current => _current as T;
|
||||
T? _current;
|
||||
}
|
||||
|
||||
main() {}
|
||||
@@ -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<BottomType> #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<BottomType> #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<BottomType> #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<BottomType> #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<BottomType> #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<BottomType> #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<BottomType> #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<BottomType> #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;
|
||||
}
|
||||
|
||||
@@ -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<BottomType> #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<BottomType> #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<BottomType> #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<BottomType> #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<BottomType> #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<BottomType> #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<BottomType> #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<BottomType> #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};
|
||||
}
|
||||
|
||||
@@ -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<BottomType> #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<BottomType> #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<BottomType> #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<BottomType> #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<BottomType> #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<BottomType> #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<BottomType> #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<BottomType> #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;
|
||||
}
|
||||
|
||||
@@ -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<BottomType> #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<BottomType> #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<BottomType> #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<BottomType> #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<BottomType> #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<BottomType> #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<BottomType> #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<BottomType> #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;
|
||||
}
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
class C<X> {
|
||||
C(void Function(X) x);
|
||||
}
|
||||
|
||||
T check<T>(C<List<T>> f) {}
|
||||
void test() {}
|
||||
main() {}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
T check<T>(C<List<T>> f) {}
|
||||
|
||||
class C<X> {
|
||||
C(void Function(X) x);
|
||||
}
|
||||
|
||||
main() {}
|
||||
void test() {}
|
||||
@@ -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<BottomType> #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<BottomType> #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?;
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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'.
|
||||
}
|
||||
|
||||
@@ -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'.
|
||||
};
|
||||
}
|
||||
|
||||
@@ -13,14 +13,14 @@ Future<B> f1(A a) async {
|
||||
// ^^^^^^^^^^^^^^^^
|
||||
// [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE
|
||||
// ^
|
||||
// [cfe] A value of type 'FutureOr<A>' can't be assigned to a variable of type 'B'.
|
||||
// [cfe] A value of type 'FutureOr<A>' can't be returned from an async function with return type 'Future<B>'.
|
||||
}
|
||||
|
||||
Future<B> f2(A a) async => a as FutureOr<A>;
|
||||
// ^^^^^^^^^^^^^^^^
|
||||
// [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE
|
||||
// ^
|
||||
// [cfe] A value of type 'FutureOr<A>' can't be assigned to a variable of type 'B'.
|
||||
// [cfe] A value of type 'FutureOr<A>' can't be returned from an async function with return type 'Future<B>'.
|
||||
|
||||
main() async {
|
||||
Object b;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<Null>`, no error.
|
||||
|
||||
@@ -12,14 +12,14 @@ Future<int> test1() async {
|
||||
return;
|
||||
//^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value must be explicitly returned from a non-void async function.
|
||||
}
|
||||
|
||||
Future<int> Function() test2 = () async {
|
||||
return;
|
||||
//^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value must be explicitly returned from a non-void async function.
|
||||
};
|
||||
|
||||
void main() {
|
||||
|
||||
@@ -12,14 +12,14 @@ FutureOr<int> test1() async {
|
||||
return;
|
||||
//^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value must be explicitly returned from a non-void async function.
|
||||
}
|
||||
|
||||
FutureOr<int> Function() test2 = () async {
|
||||
return;
|
||||
//^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value must be explicitly returned from a non-void async function.
|
||||
};
|
||||
|
||||
void main() {
|
||||
|
||||
@@ -12,7 +12,7 @@ Future<Object?> 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<Null>`, no error.
|
||||
|
||||
@@ -12,7 +12,7 @@ FutureOr<Object?> 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<Null>`, no error.
|
||||
|
||||
@@ -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<int>`, no error.
|
||||
|
||||
@@ -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<Object>`, no error.
|
||||
|
||||
@@ -15,7 +15,7 @@ void test1() async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'Future<int>?' can't be returned from an async function with return type 'void'.
|
||||
}
|
||||
|
||||
// Inferred return type of function literal is `Future<int?>`, no error.
|
||||
|
||||
@@ -15,7 +15,7 @@ void test1() async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'FutureOr<int>' can't be returned from an async function with return type 'void'.
|
||||
}
|
||||
|
||||
// Inferred return type of function literal is `Future<int>`, no error.
|
||||
|
||||
@@ -15,7 +15,7 @@ void test1() async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'Future<Object>' can't be returned from an async function with return type 'void'.
|
||||
}
|
||||
|
||||
// Inferred return type of function literal is `Future<Object>`, no error.
|
||||
|
||||
@@ -15,7 +15,7 @@ void test1() async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'FutureOr<Object>' can't be returned from an async function with return type 'void'.
|
||||
}
|
||||
|
||||
// Inferred return type of function literal is `Future<Object>`, no error.
|
||||
|
||||
@@ -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<void>`, no error.
|
||||
|
||||
@@ -15,14 +15,14 @@ Object test1() async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'Future<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 'Future<void>?' can't be returned from an async function with return type 'Object?'.
|
||||
}
|
||||
|
||||
// Inferred return type of function literal is `Future<void?>`, no error.
|
||||
|
||||
@@ -15,14 +15,14 @@ Object test1() async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'FutureOr<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 'FutureOr<void>' can't be returned from an async function with return type 'Object?'.
|
||||
}
|
||||
|
||||
// Inferred return type of function literal is `Future<void>`, no error.
|
||||
|
||||
@@ -18,7 +18,7 @@ Future<int> 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<int>'.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
||||
@@ -17,7 +17,7 @@ Future<int> 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<void>' can't be returned from an async function with return type 'Future<int>'.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
||||
@@ -17,7 +17,7 @@ Future<int> 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<void>' can't be returned from an async function with return type 'Future<int>'.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
||||
@@ -18,7 +18,7 @@ FutureOr<int> 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<int>'.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
||||
@@ -17,7 +17,7 @@ FutureOr<int> 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<void>' can't be returned from an async function with return type 'FutureOr<int>'.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
||||
@@ -17,7 +17,7 @@ FutureOr<int> 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<void>' can't be returned from an async function with return type 'FutureOr<int>'.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
||||
@@ -15,7 +15,7 @@ Future<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 'Future<Object?>'.
|
||||
}
|
||||
|
||||
// Inferred return type of function literal is `Future<void>`, no error.
|
||||
|
||||
@@ -15,7 +15,7 @@ Future<Object?> test1() async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'Future<void>' can't be returned from an async function with return type 'Future<Object?>'.
|
||||
}
|
||||
|
||||
// Inferred return type of function literal is `Future<void>`, no error.
|
||||
|
||||
@@ -15,7 +15,7 @@ Future<Object?> test1() async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'FutureOr<void>' can't be returned from an async function with return type 'Future<Object?>'.
|
||||
}
|
||||
|
||||
// Inferred return type of function literal is `Future<void>`, no error.
|
||||
|
||||
@@ -15,7 +15,7 @@ FutureOr<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 'FutureOr<Object?>'.
|
||||
}
|
||||
|
||||
// Inferred return type of function literal is `Future<void>`, no error.
|
||||
|
||||
@@ -15,21 +15,21 @@ FutureOr<Object> test1() async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'Future<void>' can't be returned from an async function with return type 'FutureOr<Object>'.
|
||||
}
|
||||
|
||||
FutureOr<Object?> test2() async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'Future<void>' can't be returned from an async function with return type 'FutureOr<Object?>'.
|
||||
}
|
||||
|
||||
FutureOr<Object> Function() test3 = () async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'Future<void>' can't be returned from an async function with return type 'FutureOr<Object>'.
|
||||
};
|
||||
|
||||
// Inferred return type of function literal is `Future<void>`, no error.
|
||||
|
||||
@@ -15,7 +15,7 @@ FutureOr<Object?> test1() async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'FutureOr<void>' can't be returned from an async function with return type 'FutureOr<Object?>'.
|
||||
}
|
||||
|
||||
// Inferred return type of function literal is `Future<void>`, no error.
|
||||
|
||||
@@ -15,14 +15,14 @@ Future<String> 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<String>'.
|
||||
}
|
||||
|
||||
Future<String> 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<String>'.
|
||||
};
|
||||
|
||||
void main() {
|
||||
|
||||
@@ -15,14 +15,14 @@ Future<String> test1() async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'Future<int>' can't be returned from an async function with return type 'Future<String>'.
|
||||
}
|
||||
|
||||
Future<String> Function() test2 = () async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'Future<int>' can't be returned from an async function with return type 'Future<String>'.
|
||||
};
|
||||
|
||||
void main() {
|
||||
|
||||
@@ -15,14 +15,14 @@ Future<int> test1() async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'FutureOr<num>' can't be returned from an async function with return type 'Future<int>'.
|
||||
}
|
||||
|
||||
Future<int> Function() test2 = () async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'FutureOr<num>' can't be returned from an async function with return type 'Future<int>'.
|
||||
};
|
||||
|
||||
void main() {
|
||||
|
||||
@@ -15,14 +15,14 @@ Future<String> test1() async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'Future<Future<String>>' can't be returned from an async function with return type 'Future<String>'.
|
||||
}
|
||||
|
||||
Future<String> Function() test2 = () async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'Future<Future<String>>' can't be returned from an async function with return type 'Future<String>'.
|
||||
};
|
||||
|
||||
void main() {
|
||||
|
||||
@@ -15,14 +15,14 @@ FutureOr<String> 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<String>'.
|
||||
}
|
||||
|
||||
FutureOr<String> 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<String>'.
|
||||
};
|
||||
|
||||
void main() {
|
||||
|
||||
@@ -15,14 +15,14 @@ FutureOr<String> test1() async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'Future<int>' can't be returned from an async function with return type 'FutureOr<String>'.
|
||||
}
|
||||
|
||||
FutureOr<String> Function() test2 = () async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'Future<int>' can't be returned from an async function with return type 'FutureOr<String>'.
|
||||
};
|
||||
|
||||
void main() {
|
||||
|
||||
@@ -15,14 +15,14 @@ FutureOr<String> test1() async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'FutureOr<int>' can't be returned from an async function with return type 'FutureOr<String>'.
|
||||
}
|
||||
|
||||
FutureOr<String> Function() test2 = () async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'FutureOr<int>' can't be returned from an async function with return type 'FutureOr<String>'.
|
||||
};
|
||||
|
||||
void main() {
|
||||
|
||||
@@ -15,14 +15,14 @@ FutureOr<String> test1() async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'Future<Future<String>>' can't be returned from an async function with return type 'FutureOr<String>'.
|
||||
}
|
||||
|
||||
FutureOr<String> Function() test2 = () async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'Future<Future<String>>' can't be returned from an async function with return type 'FutureOr<String>'.
|
||||
};
|
||||
|
||||
void main() {
|
||||
|
||||
@@ -15,7 +15,7 @@ Future<Null> test1() async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'Future<void>' can't be returned from an async function with return type 'Future<Null>'.
|
||||
}
|
||||
|
||||
// Inferred return type of function literal is `Future<Null>`.
|
||||
@@ -23,7 +23,7 @@ Future<Null> Function() test2 = () async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'Future<void>' can't be returned from an async function with return type 'Future<Null>'.
|
||||
};
|
||||
|
||||
void main() {
|
||||
|
||||
@@ -15,7 +15,7 @@ Future<Null> test1() async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'FutureOr<void>' can't be returned from an async function with return type 'Future<Null>'.
|
||||
}
|
||||
|
||||
// Inferred return type of function literal is `Future<Null>`.
|
||||
@@ -23,7 +23,7 @@ Future<Null> Function() test2 = () async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'FutureOr<void>' can't be returned from an async function with return type 'Future<Null>'.
|
||||
};
|
||||
|
||||
void main() {
|
||||
|
||||
@@ -15,7 +15,7 @@ FutureOr<Null> test1() async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'Future<void>' can't be returned from an async function with return type 'FutureOr<Null>'.
|
||||
}
|
||||
|
||||
// Inferred return type of function literal is `Future<Null>`.
|
||||
@@ -23,7 +23,7 @@ FutureOr<Null> Function() test2 = () async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'Future<void>' can't be returned from an async function with return type 'FutureOr<Null>'.
|
||||
};
|
||||
|
||||
void main() {
|
||||
|
||||
@@ -15,7 +15,7 @@ FutureOr<Null> test1() async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'FutureOr<void>' can't be returned from an async function with return type 'FutureOr<Null>'.
|
||||
}
|
||||
|
||||
// Inferred return type of function literal is `Future<Null>`.
|
||||
@@ -23,7 +23,7 @@ FutureOr<Null> Function() test2 = () async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'FutureOr<void>' can't be returned from an async function with return type 'FutureOr<Null>'.
|
||||
};
|
||||
|
||||
void main() {
|
||||
|
||||
@@ -15,7 +15,7 @@ Future<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 'Future<void>'.
|
||||
}
|
||||
|
||||
// Inferred return type of function literal is `Future<int>`, no error.
|
||||
|
||||
@@ -15,7 +15,7 @@ Future<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 'Future<void>'.
|
||||
}
|
||||
|
||||
// Inferred return type of function literal is `Future<Object>`, no error.
|
||||
|
||||
@@ -15,7 +15,7 @@ Future<void> test1() async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'FutureOr<int>' can't be returned from an async function with return type 'Future<void>'.
|
||||
}
|
||||
|
||||
// Inferred return type of function literal is `Future<int>`, no error.
|
||||
|
||||
@@ -15,7 +15,7 @@ Future<void> test1() async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'Future<int>' can't be returned from an async function with return type 'Future<void>'.
|
||||
}
|
||||
|
||||
// Inferred return type of function literal is `Future<int>`, no error.
|
||||
|
||||
@@ -15,7 +15,7 @@ FutureOr<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 'FutureOr<void>'.
|
||||
}
|
||||
|
||||
// Inferred return type of function literal is `Future<int>`, no error.
|
||||
|
||||
@@ -15,7 +15,7 @@ FutureOr<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 'FutureOr<void>'.
|
||||
}
|
||||
|
||||
// Inferred return type of function literal is `Future<Object>`, no error.
|
||||
|
||||
@@ -15,7 +15,7 @@ FutureOr<void> test1() async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'FutureOr<int>' can't be returned from an async function with return type 'FutureOr<void>'.
|
||||
}
|
||||
|
||||
// Inferred return type of function literal is `Future<int>`, no error.
|
||||
|
||||
@@ -15,7 +15,7 @@ FutureOr<void> test1() async {
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value of type 'Future<int>' can't be returned from an async function with return type 'FutureOr<void>'.
|
||||
}
|
||||
|
||||
// Inferred return type of function literal is `Future<int>`, no error.
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -11,7 +11,7 @@ Future<int>? test() {
|
||||
return;
|
||||
//^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
// [cfe] A value must be explicitly returned from a non-void function.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user