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

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

Issue 2639883005: Add parser support for covariant parameters (Closed)
Patch Set: Created 3 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 | « pkg/analyzer/lib/error/error.dart ('k') | pkg/analyzer/lib/src/error/codes.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/error/syntactic_errors.dart
diff --git a/pkg/analyzer/lib/src/dart/error/syntactic_errors.dart b/pkg/analyzer/lib/src/dart/error/syntactic_errors.dart
index 18fef4cb1080f9546e80018da3cea0a2f7ff98ca..798e30dac4623aef3b37155769a7e8d5ad444c35 100644
--- a/pkg/analyzer/lib/src/dart/error/syntactic_errors.dart
+++ b/pkg/analyzer/lib/src/dart/error/syntactic_errors.dart
@@ -82,6 +82,11 @@ class ParserErrorCode extends ErrorCode {
"For-in loops use 'in' rather than a colon.",
"Try replacing the colon with the keyword 'in'.");
+ static const ParserErrorCode CONST_AND_COVARIANT = const ParserErrorCode(
+ 'CONST_AND_COVARIANT',
+ "Members can't be declared to be both 'const' and 'covariant'.",
+ "Try removing either the 'const' or 'covariant' keyword.");
+
static const ParserErrorCode CONST_AND_FINAL = const ParserErrorCode(
'CONST_AND_FINAL',
"Members can't be declared to be both 'const' and 'final'.",
@@ -142,6 +147,27 @@ class ParserErrorCode extends ErrorCode {
"A continue statement in a switch statement must have a label as a target.",
"Try adding a label associated with one of the case clauses to the continue statement.");
+ static const ParserErrorCode COVARIANT_AFTER_VAR = const ParserErrorCode(
+ 'COVARIANT_AFTER_VAR',
+ "The modifier 'covariant' should be before the modifier 'var'.",
+ "Try re-ordering the modifiers.");
+
+ static const ParserErrorCode COVARIANT_AND_STATIC = const ParserErrorCode(
+ 'COVARIANT_AND_STATIC',
+ "Members can't be declared to be both 'covariant' and 'static'.",
+ "Try removing either the 'covariant' or 'static' keyword.");
+
+ static const ParserErrorCode COVARIANT_TOP_LEVEL_DECLARATION =
+ const ParserErrorCode(
+ 'COVARIANT_TOP_LEVEL_DECLARATION',
+ "Top-level declarations can't be declared to be covariant.",
+ "Try removing the keyword 'covariant'.");
+
+ static const ParserErrorCode COVARIANT_CONSTRUCTOR = const ParserErrorCode(
+ 'COVARIANT_CONSTRUCTOR',
+ "A constructor can't be declared to be 'covariant'.",
+ "Try removing the keyword 'covariant'.");
+
static const ParserErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPE =
const ParserErrorCode(
'DEFAULT_VALUE_IN_FUNCTION_TYPE',
@@ -322,6 +348,11 @@ class ParserErrorCode extends ErrorCode {
"Field formal parameters can only be used in a constructor.",
"Try replacing the field formal parameter with a normal parameter.");
+ static const ParserErrorCode FINAL_AND_COVARIANT = const ParserErrorCode(
+ 'FINAL_AND_COVARIANT',
+ "Members can't be declared to be both 'final' and 'covariant'.",
+ "Try removing either the 'final' or 'covariant' keyword.");
+
static const ParserErrorCode FINAL_AND_VAR = const ParserErrorCode(
'FINAL_AND_VAR',
"Members can't be declared to be both 'final' and 'var'.",
« no previous file with comments | « pkg/analyzer/lib/error/error.dart ('k') | pkg/analyzer/lib/src/error/codes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698