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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/error/StaticTypeWarningCode.java

Issue 913623002: Partial backport of analyzer async/await fixes to Java. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix status files Created 5 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
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/hint/BestPracticesVerifier.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/error/StaticTypeWarningCode.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/error/StaticTypeWarningCode.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/error/StaticTypeWarningCode.java
index 682c4c8f076eea72997d89e98793f0a5469b866d..5bd94abdcc8c6feb8aecad98fd57547b0d6c6bc7 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/error/StaticTypeWarningCode.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/error/StaticTypeWarningCode.java
@@ -41,6 +41,27 @@ public enum StaticTypeWarningCode implements ErrorCode {
"Map literal requires exactly two type arguments or none, but %d found"),
/**
+ * 9 Functions: It is a static warning if the declared return type of a function marked async* may
+ * not be assigned to Stream.
+ */
+ ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE(
+ "Functions marked 'async*' must have a return type assignable to 'Stream'"),
+
+ /**
+ * 9 Functions: It is a static warning if the declared return type of a function marked async may
+ * not be assigned to Stream.
+ */
+ ILLEGAL_ASYNC_RETURN_TYPE(
+ "Functions marked 'async' must have a return type assignable to 'Future'"),
+
+ /**
+ * 9 Functions: It is a static warning if the declared return type of a function marked sync* may
+ * not be assigned to Stream.
+ */
+ ILLEGAL_SYNC_GENERATOR_RETURN_TYPE(
+ "Functions marked 'sync*' must have a return type assignable to 'Iterable'"),
+
+ /**
* 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type
* warning if <i>T</i> does not have an accessible instance setter named <i>v=</i>.
*
@@ -325,7 +346,25 @@ public enum StaticTypeWarningCode implements ErrorCode {
* @see CompileTimeErrorCode#NEW_WITH_INVALID_TYPE_PARAMETERS
*/
WRONG_NUMBER_OF_TYPE_ARGUMENTS(
- "The type '%s' is declared with %d type parameters, but %d type arguments were given");
+ "The type '%s' is declared with %d type parameters, but %d 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:
+ * <ul>
+ * <li>the body of f is marked async* and the type Stream&lt;T&gt; may not be assigned to the
+ * declared return type of f.
+ * <li>the body of f is marked sync* and the type Iterable&lt;T&gt; may not be assigned to the
+ * declared return type of f.
+ * <p>
+ * 17.16.2 Yield-Each: 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 T may not be
+ * assigned to the declared return type of f. If f is synchronous it is a static type warning if T
+ * may not be assigned to Iterable. If f is asynchronous it is a static type warning if T may not
+ * be assigned to Stream.
+ */
+ YIELD_OF_INVALID_TYPE(
+ "The type '%s' implied by the 'yield' expression must be assignable to '%s'");
/**
* The template used to create the message to be displayed for this error.
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/hint/BestPracticesVerifier.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698