mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
[cfe] Correct PrivateNamedParameter problem message
Named parameters can't start with underscores whether they are optional or required. Change-Id: Iaaeab80f74a691b4981148f06412a60ca115f73e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337883 Auto-Submit: Parker Lougheed <parlough@gmail.com> Reviewed-by: Paul Berry <paulberry@google.com> Commit-Queue: Paul Berry <paulberry@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com>
This commit is contained in:
parent
ad138aa645
commit
b8b67c066c
|
@ -12369,7 +12369,8 @@ const Code<Null> codePrivateNamedParameter = messagePrivateNamedParameter;
|
|||
const MessageCode messagePrivateNamedParameter = const MessageCode(
|
||||
"PrivateNamedParameter",
|
||||
analyzerCodes: <String>["PRIVATE_OPTIONAL_PARAMETER"],
|
||||
problemMessage: r"""An optional named parameter can't start with '_'.""");
|
||||
problemMessage:
|
||||
r"""A named parameter can't start with an underscore ('_').""");
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
const Code<Null> codeRecordFieldsCantBePrivate =
|
||||
|
|
|
@ -1995,7 +1995,7 @@ FunctionTypeDefaultValue:
|
|||
analyzerCode: DEFAULT_VALUE_IN_FUNCTION_TYPE
|
||||
|
||||
PrivateNamedParameter:
|
||||
problemMessage: "An optional named parameter can't start with '_'."
|
||||
problemMessage: "A named parameter can't start with an underscore ('_')."
|
||||
analyzerCode: PRIVATE_OPTIONAL_PARAMETER
|
||||
|
||||
NoFormals:
|
||||
|
|
|
@ -11,8 +11,7 @@ class Foo {
|
|||
Foo.private({this._y = 77}) {}
|
||||
// ^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.PRIVATE_OPTIONAL_PARAMETER
|
||||
// ^
|
||||
// [cfe] An optional named parameter can't start with '_'.
|
||||
// [cfe] A named parameter can't start with an underscore ('_').
|
||||
}
|
||||
|
||||
main() {
|
||||
|
|
Loading…
Reference in a new issue