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

Unified Diff: pkg/analyzer/lib/src/generated/error.dart

Issue 895113002: Add static type checking of "yield" statements to analyzer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/error_verifier.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/error.dart
diff --git a/pkg/analyzer/lib/src/generated/error.dart b/pkg/analyzer/lib/src/generated/error.dart
index f9411ef8fa5028af35cc29fee855e5d307e3517a..e5faa78996adcbd367efa2bd98c284b204a6b5f5 100644
--- a/pkg/analyzer/lib/src/generated/error.dart
+++ b/pkg/analyzer/lib/src/generated/error.dart
@@ -3716,6 +3716,22 @@ class StaticTypeWarningCode extends ErrorCode {
"The type '{0}' is declared with {1} type parameters, but {2} type arguments were given");
/**
+ * 17.16.1 Yield: Let T be the static type of e [the expression to the right
+ * of "yield"] and let f be the immediately enclosing function. It is a
+ * static type warning if either:
+ *
+ * - the body of f is marked async* and the type Stream<T> may not be
+ * assigned to the declared return type of f.
+ *
+ * - the body of f is marked sync* and the type Iterable<T> may not be
+ * assigned to the declared return type of f.
+ */
+ static const StaticTypeWarningCode YIELD_OF_INVALID_TYPE =
+ const StaticTypeWarningCode(
+ 'YIELD_OF_INVALID_TYPE',
+ "The declared return type '{0}' is incompatible with the type '{1}' implied by the 'yield' expression");
+
+ /**
* Initialize a newly created error code to have the given [name]. The message
* associated with the error will be created from the given [message]
* template. The correction associated with the error will be created from the
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/error_verifier.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698