mirror of
https://github.com/dart-lang/sdk
synced 2024-09-15 23:49:47 +00:00
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>
This commit is contained in:
parent
92c07fa8d2
commit
6b3f3403ec
|
@ -5039,7 +5039,8 @@ class CompileTimeErrorCode extends AnalyzerErrorCode {
|
|||
* 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 @@ class CompileTimeErrorCode extends AnalyzerErrorCode {
|
|||
* 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}'.",
|
||||
|
|
|
@ -9,7 +9,7 @@ class ListLiteral2NegativeTest<T> {
|
|||
// 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.
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ class MapLiteral2NegativeTest<T> {
|
|||
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.
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ class ListLiteral2NegativeTest<T> {
|
|||
// 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.
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ class MapLiteral2NegativeTest<T> {
|
|||
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.
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue