Unify three diagnostic codes for documentation purposes

Change-Id: I46326160fedb26c92843698dd6513b9fe87e32dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169041
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
diff --git a/pkg/analyzer/lib/src/error/codes.dart b/pkg/analyzer/lib/src/error/codes.dart
index c9df73a..6489ae9 100644
--- a/pkg/analyzer/lib/src/error/codes.dart
+++ b/pkg/analyzer/lib/src/error/codes.dart
@@ -5039,7 +5039,8 @@
    * 0: the name of the type parameter
    */
   static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_LIST =
-      CompileTimeErrorCode(
+      CompileTimeErrorCodeWithUniqueName(
+          'INVALID_TYPE_ARGUMENT_IN_CONST_LITERAL',
           'INVALID_TYPE_ARGUMENT_IN_CONST_LIST',
           "Constant list literals can't include a type parameter as a type "
               "argument, such as '{0}'.",
@@ -5054,15 +5055,21 @@
    * 0: the name of the type parameter
    */
   static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_MAP =
-      CompileTimeErrorCode(
+      CompileTimeErrorCodeWithUniqueName(
+          'INVALID_TYPE_ARGUMENT_IN_CONST_LITERAL',
           'INVALID_TYPE_ARGUMENT_IN_CONST_MAP',
           "Constant map literals can't include a type parameter as a type "
               "argument, such as '{0}'.",
           correction:
               "Try replacing the type parameter with a different type.");
 
+  /**
+   * Parameters:
+   * 0: the name of the type parameter
+   */
   static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_SET =
-      CompileTimeErrorCode(
+      CompileTimeErrorCodeWithUniqueName(
+          'INVALID_TYPE_ARGUMENT_IN_CONST_LITERAL',
           'INVALID_TYPE_ARGUMENT_IN_CONST_SET',
           "Constant set literals can't include a type parameter as a type "
               "argument, such as '{0}'.",
diff --git a/tests/language/list/literal6_test.dart b/tests/language/list/literal6_test.dart
index 7d6e3d9..f066509 100644
--- a/tests/language/list/literal6_test.dart
+++ b/tests/language/list/literal6_test.dart
@@ -9,7 +9,7 @@
     // Type parameter is not allowed with const.
     var m = const <T>[];
     //             ^
-    // [analyzer] COMPILE_TIME_ERROR.INVALID_TYPE_ARGUMENT_IN_CONST_LIST
+    // [analyzer] COMPILE_TIME_ERROR.INVALID_TYPE_ARGUMENT_IN_CONST_LITERAL
     // [cfe] Type variables can't be used as constants.
   }
 }
diff --git a/tests/language/map/literal14_test.dart b/tests/language/map/literal14_test.dart
index 4351eb9..1b4108f 100644
--- a/tests/language/map/literal14_test.dart
+++ b/tests/language/map/literal14_test.dart
@@ -8,7 +8,7 @@
   test() {
     var m = const <String, T>{};
     //                     ^
-    // [analyzer] COMPILE_TIME_ERROR.INVALID_TYPE_ARGUMENT_IN_CONST_MAP
+    // [analyzer] COMPILE_TIME_ERROR.INVALID_TYPE_ARGUMENT_IN_CONST_LITERAL
     // [cfe] Type variables can't be used as constants.
   }
 }
diff --git a/tests/language_2/list/literal6_test.dart b/tests/language_2/list/literal6_test.dart
index 7d6e3d9..f066509 100644
--- a/tests/language_2/list/literal6_test.dart
+++ b/tests/language_2/list/literal6_test.dart
@@ -9,7 +9,7 @@
     // Type parameter is not allowed with const.
     var m = const <T>[];
     //             ^
-    // [analyzer] COMPILE_TIME_ERROR.INVALID_TYPE_ARGUMENT_IN_CONST_LIST
+    // [analyzer] COMPILE_TIME_ERROR.INVALID_TYPE_ARGUMENT_IN_CONST_LITERAL
     // [cfe] Type variables can't be used as constants.
   }
 }
diff --git a/tests/language_2/map/literal14_test.dart b/tests/language_2/map/literal14_test.dart
index 4351eb9..1b4108f 100644
--- a/tests/language_2/map/literal14_test.dart
+++ b/tests/language_2/map/literal14_test.dart
@@ -8,7 +8,7 @@
   test() {
     var m = const <String, T>{};
     //                     ^
-    // [analyzer] COMPILE_TIME_ERROR.INVALID_TYPE_ARGUMENT_IN_CONST_MAP
+    // [analyzer] COMPILE_TIME_ERROR.INVALID_TYPE_ARGUMENT_IN_CONST_LITERAL
     // [cfe] Type variables can't be used as constants.
   }
 }