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

Unified Diff: pkg/compiler/lib/src/diagnostics/messages.dart

Issue 2699073003: Support `void` as generic argument.
Patch Set: Shuffle things around to have a better `voidRti` locality. Created 3 years, 7 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/compiler/lib/src/elements/resolution_types.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/diagnostics/messages.dart
diff --git a/pkg/compiler/lib/src/diagnostics/messages.dart b/pkg/compiler/lib/src/diagnostics/messages.dart
index a750c41d2d09f27222f02d18b4ec7831d8a80ef4..796e8336c49db8c14278071c840c5ad9f22d5a34 100644
--- a/pkg/compiler/lib/src/diagnostics/messages.dart
+++ b/pkg/compiler/lib/src/diagnostics/messages.dart
@@ -44,6 +44,7 @@ enum MessageKind {
ASYNC_MODIFIER_ON_ABSTRACT_METHOD,
ASYNC_MODIFIER_ON_CONSTRUCTOR,
ASYNC_MODIFIER_ON_SETTER,
+ AWAIT_FORIN_VOID_GENERIC,
AWAIT_MEMBER_NOT_FOUND,
AWAIT_MEMBER_NOT_FOUND_IN_CLOSURE,
BAD_INPUT_CHARACTER,
@@ -153,6 +154,7 @@ enum MessageKind {
FINAL_FUNCTION_TYPE_PARAMETER,
FINAL_WITHOUT_INITIALIZER,
FORIN_NOT_ASSIGNABLE,
+ FORIN_VOID_GENERIC,
FORMAL_DECLARED_CONST,
FORMAL_DECLARED_STATIC,
FUNCTION_TYPE_FORMAL_WITH_DEFAULT,
@@ -474,6 +476,18 @@ class MessageTemplate {
MessageKind.VOID_VARIABLE: const MessageTemplate(
MessageKind.VOID_VARIABLE, "Variable cannot be of type void."),
+ MessageKind.FORIN_VOID_GENERIC: const MessageTemplate(
+ MessageKind.FORIN_VOID_GENERIC,
+ "Generic type of Iterable cannot be of type void.",
+ examples: const [
+ """
+main() {
+ for (var x in new List<void>()) {
+ }
+}
+"""
+ ]),
+
MessageKind.RETURN_VALUE_IN_VOID: const MessageTemplate(
MessageKind.RETURN_VALUE_IN_VOID,
"Cannot return value from void function."),
@@ -493,6 +507,19 @@ class MessageTemplate {
MessageKind.NAMED_ARGUMENT_NOT_FOUND,
"No named argument '#{argumentName}' found on method."),
+ MessageKind.AWAIT_FORIN_VOID_GENERIC: const MessageTemplate(
+ MessageKind.AWAIT_FORIN_VOID_GENERIC,
+ "Generic type of Stream cannot be of type void.",
+ examples: const [
+ """
+import 'dart:async';
+main() async {
+ await for (var x in new StreamView<void>(null)) {
+ }
+}
+"""
+ ]),
+
MessageKind.AWAIT_MEMBER_NOT_FOUND: const MessageTemplate(
MessageKind.AWAIT_MEMBER_NOT_FOUND,
"No member named 'await' in class '#{className}'.",
« no previous file with comments | « no previous file | pkg/compiler/lib/src/elements/resolution_types.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698