[PrimaryConstructors] Update test expectations

This updates the test expectations for the CFE.

Part of #61700

Change-Id: Iad25b48ab10809c95e2489821b318c6435f96ec0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/485800
Reviewed-by: Kallen Tu <kallentu@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This commit is contained in:
Johnni Winther
2026-03-06 00:16:34 -08:00
committed by Commit Queue
parent b8389a7de2
commit 44b6fe89e7
@@ -16,64 +16,65 @@ class C1({required final String _foo}) {
final String _foo;
// ^^^^
// [analyzer] unspecified
// [cfe] unspecified
// [cfe] '_foo' is already declared in this scope.
}
/// Collide with previous private declaring parameter.
class C2({required final String _foo, required final String _foo}) {}
// ^^^^
// [analyzer] unspecified
// [cfe] unspecified
// [cfe] '_foo' is already declared in this scope.
// [cfe] Duplicated parameter name '_foo'.
/// Collide with previous public declaring parameter.
class C3({required final String foo, required final String _foo}) {}
// ^^^^
// [analyzer] COMPILE_TIME_ERROR.PRIVATE_NAMED_PARAMETER_DUPLICATE_PUBLIC_NAME
// [cfe] unspecified
// [cfe] The corresponding public name 'foo' is already the name of another parameter.
/// Collide with previous private named parameter.
class C4({String? _foo, required final String _foo}) {}
// ^^^^
// [analyzer] SYNTACTIC_ERROR.PRIVATE_NAMED_NON_FIELD_PARAMETER
// [cfe] unspecified
// [cfe] A named parameter that doesn't refer to an instance variable can't start with an underscore ('_').
// ^^^^
// [analyzer] COMPILE_TIME_ERROR.DUPLICATE_DEFINITION
// [cfe] unspecified
// [cfe] Duplicated parameter name '_foo'.
/// Collide with previous public named parameter.
class C5({String? foo, required final String _foo}) {}
// ^^^^
// [analyzer] COMPILE_TIME_ERROR.PRIVATE_NAMED_PARAMETER_DUPLICATE_PUBLIC_NAME
// [cfe] unspecified
// [cfe] The corresponding public name 'foo' is already the name of another parameter.
/// Collide with previous private positional parameter.
class C6(String _foo, {required final String _foo}) {}
// ^^^^
// [analyzer] COMPILE_TIME_ERROR.DUPLICATE_DEFINITION
// [cfe] unspecified
// [cfe] Duplicated parameter name '_foo'.
/// Collide with previous public positional parameter.
class C7(String? foo, {required final String _foo}) {}
// ^^^^
// [analyzer] COMPILE_TIME_ERROR.PRIVATE_NAMED_PARAMETER_DUPLICATE_PUBLIC_NAME
// [cfe] unspecified
// [cfe] The corresponding public name 'foo' is already the name of another parameter.
/// Collide with previous private initializing formal.
class C8(this._foo, {required final String _foo}) {
// ^^^^
// [analyzer] COMPILE_TIME_ERROR.DUPLICATE_DEFINITION
// [cfe] unspecified
// [cfe] Duplicated parameter name '_foo'.
final String _foo;
// ^^^^
// [analyzer] COMPILE_TIME_ERROR.DUPLICATE_DEFINITION
// [cfe] unspecified
// [cfe] '_foo' is already declared in this scope.
}
/// Collide with previous public initializing formal.
class C9(this.foo, {required final String _foo}) {
// ^^^^
// [analyzer] COMPILE_TIME_ERROR.PRIVATE_NAMED_PARAMETER_DUPLICATE_PUBLIC_NAME
// [cfe] unspecified
// [cfe] The corresponding public name 'foo' is already the name of another parameter.
final String foo;
}
@@ -81,32 +82,32 @@ class C9(this.foo, {required final String _foo}) {
class C10({required final String _foo, String? _foo}) {}
// ^^^^
// [analyzer] COMPILE_TIME_ERROR.DUPLICATE_DEFINITION
// ^^^^
// [analyzer] SYNTACTIC_ERROR.PRIVATE_NAMED_NON_FIELD_PARAMETER
// [cfe] unspecified
// [cfe] A named parameter that doesn't refer to an instance variable can't start with an underscore ('_').
// [cfe] Duplicated parameter name '_foo'.
/// Collide with later public named parameter.
class C11({required final String _foo, String? foo}) {}
// ^^^^
// [analyzer] COMPILE_TIME_ERROR.PRIVATE_NAMED_PARAMETER_DUPLICATE_PUBLIC_NAME
// [cfe] unspecified
// [cfe] The corresponding public name 'foo' is already the name of another parameter.
/// Collide with later private initializing formal.
class C12({required final String _foo, required this._foo}) {
// ^^^^
// [analyzer] COMPILE_TIME_ERROR.DUPLICATE_DEFINITION
// [cfe] unspecified
// [cfe] Duplicated parameter name '_foo'.
final String _foo;
// ^^^^
// [analyzer] COMPILE_TIME_ERROR.DUPLICATE_DEFINITION
// [cfe] unspecified
// [cfe] '_foo' is already declared in this scope.
}
/// Collide with later public initializing formal.
class C13({required final String _foo, required this.foo}) {
// ^^^^
// [analyzer] COMPILE_TIME_ERROR.PRIVATE_NAMED_PARAMETER_DUPLICATE_PUBLIC_NAME
// [cfe] unspecified
// [cfe] The corresponding public name 'foo' is already the name of another parameter.
final String foo;
}