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 dbcab63845a57e207d591acf26d6ac936418d536..893b447dd5f780e8cfba739eb54233ee0db6c5bf 100644 |
--- a/pkg/compiler/lib/src/diagnostics/messages.dart |
+++ b/pkg/compiler/lib/src/diagnostics/messages.dart |
@@ -186,9 +186,11 @@ enum MessageKind { |
DUPLICATED_RESOURCE, |
EMPTY_CATCH_DECLARATION, |
EMPTY_ENUM_DECLARATION, |
+ EMPTY_NAMED_PARAMETER_LIST, |
+ EMPTY_OPTIONAL_PARAMETER_LIST, |
EMPTY_HIDE, |
- EQUAL_MAP_ENTRY_KEY, |
EMPTY_SHOW, |
+ EQUAL_MAP_ENTRY_KEY, |
EXISTING_DEFINITION, |
EXISTING_LABEL, |
EXPECTED_IDENTIFIER_NOT_RESERVED_WORD, |
@@ -878,6 +880,36 @@ main() {}""" |
}, |
]), |
+ MessageKind.EMPTY_OPTIONAL_PARAMETER_LIST: const MessageTemplate( |
+ MessageKind.EMPTY_OPTIONAL_PARAMETER_LIST, |
+ "Optional parameter lists cannot be empty.", |
+ howToFix: "Try adding an optional parameter to the list.", |
+ examples: const [ |
+ const { |
+ 'main.dart': """ |
+foo([]) {} |
+ |
+main() { |
+ foo(); |
+}""" |
+ } |
+ ]), |
+ |
+ MessageKind.EMPTY_NAMED_PARAMETER_LIST: const MessageTemplate( |
+ MessageKind.EMPTY_NAMED_PARAMETER_LIST, |
+ "Named parameter lists cannot be empty.", |
+ howToFix: "Try adding a named parameter to the list.", |
+ examples: const [ |
+ const { |
+ 'main.dart': """ |
+foo({}) {} |
+ |
+main() { |
+ foo(); |
+}""" |
+ } |
+ ]), |
+ |
MessageKind.NOT_A_TYPE: const MessageTemplate( |
MessageKind.NOT_A_TYPE, "'#{node}' is not a type."), |