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

Unified Diff: pkg/analyzer/lib/src/generated/testing/test_type_provider.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/testing/test_type_provider.dart
diff --git a/pkg/analyzer/lib/src/generated/testing/test_type_provider.dart b/pkg/analyzer/lib/src/generated/testing/test_type_provider.dart
index 8460484fd2dceeaaba9b7b6f6b7b2a3846d5c1db..cb70a5333183e6f887d0a72c26e7c67546f1b6c5 100644
--- a/pkg/analyzer/lib/src/generated/testing/test_type_provider.dart
+++ b/pkg/analyzer/lib/src/generated/testing/test_type_provider.dart
@@ -66,6 +66,11 @@ class TestTypeProvider extends TypeProviderBase {
/**
* The type representing the built-in type 'FutureOr'
*/
+ InterfaceType _futureOrNullType;
+
+ /**
+ * The type representing the built-in type 'FutureOr'
+ */
InterfaceType _futureOrType;
/**
@@ -267,6 +272,14 @@ class TestTypeProvider extends TypeProviderBase {
}
@override
+ InterfaceType get futureOrNullType {
+ if (_futureOrNullType == null) {
+ _futureOrNullType = futureOrType.instantiate(<DartType>[nullType]);
+ }
+ return _futureOrNullType;
+ }
+
+ @override
InterfaceType get futureOrType {
if (_futureOrType == null) {
Source asyncSource = _context.sourceFactory.forUri(DartSdk.DART_ASYNC);

Powered by Google App Engine
This is Rietveld 408576698