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

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: Avoid merge conflict Created 3 years, 11 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 7285f1ddfb6387df20297d5895e88bae232f7763..00455ed019fc7493ddc58562d3b6b3a17200a4ac 100644
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
@@ -2306,7 +2306,10 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
return;
}
}
- } else if (expectedReturnType.isDynamic || expectedReturnType.isVoid) {
+ } else if (expectedReturnType.isDynamic ||
+ expectedReturnType.isVoid ||
+ _typeSystem.isSubtypeOf(
+ expectedReturnType, _typeProvider.futureOrNullType)) {
Jennifer Messerly 2017/02/03 18:47:53 If I have: Future<Null> foo() { return;
Leaf 2017/02/06 18:27:15 Good catch, thanks! Fixed to keep it simple for n
return;
}
_hasReturnWithoutValue = true;
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | pkg/analyzer/test/generated/strong_mode_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698