Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Unified Diff: pkg/analyzer/lib/src/generated/error_verifier.dart

Issue 2667343005: Infer Null for return type of functions with empty returns. (Closed)
Patch Set: Address comments, fix 28630, ddc expectations Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/lib/src/generated/error_verifier.dart
diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart
index aa0f4966e01a3ec2d090f3cf5e7484aa313ee11f..c4ebab67fa4fec985c9ba87bdd0f472fc7953221 100644
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
@@ -2306,7 +2306,9 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
return;
}
}
- } else if (expectedReturnType.isDynamic || expectedReturnType.isVoid) {
+ } else if (expectedReturnType.isDynamic ||
+ expectedReturnType.isVoid ||
+ expectedReturnType.isDartCoreNull) {
return;
}
_hasReturnWithoutValue = true;
@@ -2513,7 +2515,6 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
DartType actualStaticType,
DartType expectedStaticType,
ErrorCode errorCode) {
- // TODO(leafp): Move the Downcast functionality here.
if (!_expressionIsAssignableAtType(
expression, actualStaticType, expectedStaticType)) {
_errorReporter.reportTypeErrorForNode(
@@ -6252,7 +6253,6 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
if (concrete && actualStaticType is FunctionType) {
actualStaticType =
_typeSystem.functionTypeToConcreteType(actualStaticType);
- // TODO(leafp): Move the Downcast functionality here.
}
return _typeSystem.isAssignableTo(actualStaticType, expectedStaticType);
}
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | pkg/analyzer/lib/src/generated/resolver.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698