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

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

Issue 1771153002: Type check for-in statements. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Update to latest on master. Created 4 years, 9 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/error.dart
diff --git a/pkg/analyzer/lib/src/generated/error.dart b/pkg/analyzer/lib/src/generated/error.dart
index 2a6509c505d9ef45bfdc9d0e9d6196d65898cf4e..7d77680290468ec889b99b59c75dec0b099c8727 100644
--- a/pkg/analyzer/lib/src/generated/error.dart
+++ b/pkg/analyzer/lib/src/generated/error.dart
@@ -2743,6 +2743,8 @@ abstract class ErrorCode {
StaticTypeWarningCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER,
StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS,
StaticTypeWarningCode.YIELD_OF_INVALID_TYPE,
+ StaticTypeWarningCode.FOR_IN_OF_INVALID_TYPE,
+ StaticTypeWarningCode.FOR_IN_OF_INVALID_ELEMENT_TYPE,
StaticWarningCode.AMBIGUOUS_IMPORT,
StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE,
StaticWarningCode.ASSIGNMENT_TO_CONST,
@@ -4396,6 +4398,32 @@ class StaticTypeWarningCode extends ErrorCode {
"The type '{0}' implied by the 'yield' expression must be assignable to '{1}'");
/**
+ * 17.6.2 For-in. If the iterable expression does not implement Iterable,
+ * this warning is reported.
+ *
+ * Parameters:
+ * 0: The type of the iterable expression.
+ * 1: The sequence type -- Iterable for `for` or Stream for `await for`.
+ */
+ static const StaticTypeWarningCode FOR_IN_OF_INVALID_TYPE =
+ const StaticTypeWarningCode('FOR_IN_OF_INVALID_TYPE',
+ "The type '{0}' used in the 'for' loop must implement {1}");
+
+ /**
+ * 17.6.2 For-in. It the iterable expression does not implement Iterable with
+ * a type argument that can be assigned to the for-in variable's type, this
+ * warning is reported.
+ *
+ * Parameters:
+ * 0: The type of the iterable expression.
+ * 1: The sequence type -- Iterable for `for` or Stream for `await for`.
+ * 2: The loop variable type.
+ */
+ static const StaticTypeWarningCode FOR_IN_OF_INVALID_ELEMENT_TYPE =
+ const StaticTypeWarningCode('FOR_IN_OF_INVALID_ELEMENT_TYPE',
+ "The type '{0}' used in the 'for' loop must implement {1} with a type argument that can be assigned to '{2}'");
+
+ /**
* 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

Powered by Google App Engine
This is Rietveld 408576698