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

Unified Diff: pkg/analyzer/lib/src/summary/link.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/summary/link.dart
diff --git a/pkg/analyzer/lib/src/summary/link.dart b/pkg/analyzer/lib/src/summary/link.dart
index c1f9f67b553335322ec528030db7408442043325..a97a11b7a794dfdc5aa788989eb7db2b5c5509f8 100644
--- a/pkg/analyzer/lib/src/summary/link.dart
+++ b/pkg/analyzer/lib/src/summary/link.dart
@@ -4729,6 +4729,7 @@ class TypeProviderForLink extends TypeProviderBase {
InterfaceType _functionType;
InterfaceType _futureDynamicType;
InterfaceType _futureNullType;
+ InterfaceType _futureOrNullType;
InterfaceType _futureOrType;
InterfaceType _futureType;
InterfaceType _intType;
@@ -4779,6 +4780,10 @@ class TypeProviderForLink extends TypeProviderBase {
_futureNullType ??= futureType.instantiate(<DartType>[nullType]);
@override
+ InterfaceType get futureOrNullType =>
+ _futureOrNullType ??= futureOrType.instantiate(<DartType>[nullType]);
+
+ @override
InterfaceType get futureOrType =>
_futureOrType ??= _buildInterfaceType(_linker.asyncLibrary, 'FutureOr');

Powered by Google App Engine
This is Rietveld 408576698