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

Unified Diff: pkg/analyzer/lib/src/summary/summary_sdk.dart

Issue 2581803002: Add access to FutureOr in TypeProviders (and add implementation in mock sdks) (Closed)
Patch Set: Created 4 years 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/summary_sdk.dart
diff --git a/pkg/analyzer/lib/src/summary/summary_sdk.dart b/pkg/analyzer/lib/src/summary/summary_sdk.dart
index 3142b291e16cb47b47879b719437d85e9af83d2f..ac6d4b3e0e3370c7ca75204fdb27e94641479244 100644
--- a/pkg/analyzer/lib/src/summary/summary_sdk.dart
+++ b/pkg/analyzer/lib/src/summary/summary_sdk.dart
@@ -200,6 +200,7 @@ class SummaryTypeProvider extends TypeProviderBase {
InterfaceType _functionType;
InterfaceType _futureDynamicType;
InterfaceType _futureNullType;
+ InterfaceType _futureOrType;
InterfaceType _futureType;
InterfaceType _intType;
InterfaceType _iterableDynamicType;
@@ -266,6 +267,13 @@ class SummaryTypeProvider extends TypeProviderBase {
}
@override
+ InterfaceType get futureOrType {
+ assert(_asyncLibrary != null);
+ _futureOrType ??= _getType(_asyncLibrary, "FutureOr");
+ return _futureOrType;
+ }
+
+ @override
InterfaceType get futureType {
assert(_asyncLibrary != null);
_futureType ??= _getType(_asyncLibrary, "Future");

Powered by Google App Engine
This is Rietveld 408576698