Unify two diagnostic codes for documentation purposes

Change-Id: I1b37dc4584757da4833f111c2ea4c3d9511513db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198901
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
Brian Wilkerson 2021-05-09 15:51:28 +00:00 committed by commit-bot@chromium.org
parent 90127334ea
commit 62feca7095
7 changed files with 13 additions and 11 deletions

View file

@ -1581,14 +1581,15 @@ class CompileTimeErrorCode extends AnalyzerErrorCode {
* basename `n`.
*
* Parameters:
* 0: the name of the constructor
* 0: the name of the field
*/
static const CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_AND_STATIC_FIELD =
CompileTimeErrorCode(
'CONFLICTING_CONSTRUCTOR_AND_STATIC_FIELD',
'CONFLICTING_CONSTRUCTOR_AND_STATIC_MEMBER',
"'{0}' can't be used to name both a constructor and a static field "
"in this class.",
correction: "Try renaming either the constructor or the field.");
correction: "Try renaming either the constructor or the field.",
uniqueName: 'CONFLICTING_CONSTRUCTOR_AND_STATIC_FIELD');
/**
* 10.11 Class Member Conflicts: Let `C` be a class. It is a compile-time
@ -1600,10 +1601,11 @@ class CompileTimeErrorCode extends AnalyzerErrorCode {
*/
static const CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_AND_STATIC_METHOD =
CompileTimeErrorCode(
'CONFLICTING_CONSTRUCTOR_AND_STATIC_METHOD',
'CONFLICTING_CONSTRUCTOR_AND_STATIC_MEMBER',
"'{0}' can't be used to name both a constructor and a static method "
"in this class.",
correction: "Try renaming either the constructor or the method.");
correction: "Try renaming either the constructor or the method.",
uniqueName: 'CONFLICTING_CONSTRUCTOR_AND_STATIC_METHOD');
/**
* 10.11 Class Member Conflicts: Let `C` be a class. It is a compile-time

View file

@ -11,7 +11,7 @@ class C {
//^
// [cfe] Conflicts with member 'n'.
// ^
// [analyzer] COMPILE_TIME_ERROR.CONFLICTING_CONSTRUCTOR_AND_STATIC_FIELD
// [analyzer] COMPILE_TIME_ERROR.CONFLICTING_CONSTRUCTOR_AND_STATIC_MEMBER
static int get n {
// ^

View file

@ -11,7 +11,7 @@ class C {
//^
// [cfe] Conflicts with member 'n'.
// ^
// [analyzer] COMPILE_TIME_ERROR.CONFLICTING_CONSTRUCTOR_AND_STATIC_METHOD
// [analyzer] COMPILE_TIME_ERROR.CONFLICTING_CONSTRUCTOR_AND_STATIC_MEMBER
static int n() {
// ^

View file

@ -11,7 +11,7 @@ class C {
//^
// [cfe] Conflicts with setter 'n'.
// ^
// [analyzer] COMPILE_TIME_ERROR.CONFLICTING_CONSTRUCTOR_AND_STATIC_FIELD
// [analyzer] COMPILE_TIME_ERROR.CONFLICTING_CONSTRUCTOR_AND_STATIC_MEMBER
static set n(int x) {}
// ^

View file

@ -13,7 +13,7 @@ class C {
//^
// [cfe] Conflicts with member 'n'.
// ^
// [analyzer] COMPILE_TIME_ERROR.CONFLICTING_CONSTRUCTOR_AND_STATIC_FIELD
// [analyzer] COMPILE_TIME_ERROR.CONFLICTING_CONSTRUCTOR_AND_STATIC_MEMBER
static int get n {
// ^

View file

@ -13,7 +13,7 @@ class C {
//^
// [cfe] Conflicts with member 'n'.
// ^
// [analyzer] COMPILE_TIME_ERROR.CONFLICTING_CONSTRUCTOR_AND_STATIC_METHOD
// [analyzer] COMPILE_TIME_ERROR.CONFLICTING_CONSTRUCTOR_AND_STATIC_MEMBER
static int n() {
// ^

View file

@ -13,7 +13,7 @@ class C {
//^
// [cfe] Conflicts with setter 'n'.
// ^
// [analyzer] COMPILE_TIME_ERROR.CONFLICTING_CONSTRUCTOR_AND_STATIC_FIELD
// [analyzer] COMPILE_TIME_ERROR.CONFLICTING_CONSTRUCTOR_AND_STATIC_MEMBER
static set n(int x) {}
// ^