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

Unified Diff: pkg/analyzer/lib/src/dart/element/type.dart

Issue 2647833002: fix #28008, fix #28009 implement FutureOr<T> (Closed)
Patch Set: add test 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/dart/element/type.dart
diff --git a/pkg/analyzer/lib/src/dart/element/type.dart b/pkg/analyzer/lib/src/dart/element/type.dart
index dab72dcd6a70cc0dc0a8eb023013f18297cc3e36..253bf99b3903b4fef1792006d237df9fa3eef610 100644
--- a/pkg/analyzer/lib/src/dart/element/type.dart
+++ b/pkg/analyzer/lib/src/dart/element/type.dart
@@ -1387,6 +1387,15 @@ class InterfaceTypeImpl extends TypeImpl implements InterfaceType {
}
@override
+ bool get isDartAsyncFutureOr {
+ ClassElement element = this.element;
+ if (element == null) {
+ return false;
+ }
+ return element.name == "FutureOr" && element.library.isDartAsync;
+ }
+
+ @override
bool get isDartCoreFunction {
ClassElement element = this.element;
if (element == null) {
@@ -2377,6 +2386,9 @@ abstract class TypeImpl implements DartType {
bool get isDartAsyncFuture => false;
@override
+ bool get isDartAsyncFutureOr => false;
+
+ @override
bool get isDartCoreFunction => false;
@override

Powered by Google App Engine
This is Rietveld 408576698