Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 3405258

Browse files
author
Dart CI
committed
Version 2.13.0-43.0.dev
Merge commit '9474c2355d9eff50f759b45b2533e989dade778e' into 'dev'
2 parents 494cd25 + 9474c23 commit 3405258

File tree

7 files changed

+293
-204
lines changed

7 files changed

+293
-204
lines changed

pkg/analyzer/lib/src/generated/error_verifier.dart

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -931,8 +931,13 @@ class ErrorVerifier extends RecursiveAstVisitor<void> {
931931
_checkForWrongNumberOfParametersForSetter(node.name, node.parameters);
932932
_checkForNonVoidReturnTypeForSetter(returnType);
933933
} else if (node.isOperator) {
934-
_checkForOptionalParameterInOperator(node);
935-
_checkForWrongNumberOfParametersForOperator(node);
934+
var hasWrongNumberOfParameters =
935+
_checkForWrongNumberOfParametersForOperator(node);
936+
if (!hasWrongNumberOfParameters) {
937+
// If the operator has too many parameters including one or more
938+
// optional parameters, only report one error.
939+
_checkForOptionalParameterInOperator(node);
940+
}
936941
_checkForNonVoidReturnTypeForOperator(node);
937942
}
938943
_checkForExtensionDeclaresMemberOfObject(node);
@@ -4593,12 +4598,12 @@ class ErrorVerifier extends RecursiveAstVisitor<void> {
45934598
/// operator declaration before being called.
45944599
///
45954600
/// See [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR].
4596-
void _checkForWrongNumberOfParametersForOperator(
4601+
bool _checkForWrongNumberOfParametersForOperator(
45974602
MethodDeclaration declaration) {
45984603
// prepare number of parameters
45994604
var parameterList = declaration.parameters;
46004605
if (parameterList == null) {
4601-
return;
4606+
return false;
46024607
}
46034608
int numParameters = parameterList.parameters.length;
46044609
// prepare operator name
@@ -4634,12 +4639,15 @@ class ErrorVerifier extends RecursiveAstVisitor<void> {
46344639
CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR,
46354640
nameNode,
46364641
[name, expected, numParameters]);
4642+
return true;
46374643
} else if ("-" == name && numParameters > 1) {
46384644
_errorReporter.reportErrorForNode(
46394645
CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS,
46404646
nameNode,
46414647
[numParameters]);
4648+
return true;
46424649
}
4650+
return false;
46434651
}
46444652

46454653
/// Verify that the given setter [parameterList] has only one required

runtime/vm/BUILD.gn

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ library_for_all_configs("libdart_vm") {
7474
if (is_fuchsia) {
7575
if (using_fuchsia_gn_sdk) {
7676
extra_deps = [
77-
"$fuchsia_sdk_root/fidl/fuchsia.deprecatedtimezone",
77+
"$fuchsia_sdk_root/fidl/fuchsia.intl",
7878
"$fuchsia_sdk_root/pkg/async",
7979
"$fuchsia_sdk_root/pkg/async-default",
8080
"$fuchsia_sdk_root/pkg/async-loop",
@@ -87,7 +87,7 @@ library_for_all_configs("libdart_vm") {
8787
]
8888
} else if (using_fuchsia_sdk) {
8989
extra_deps = [
90-
"$fuchsia_sdk_root/fidl:fuchsia.deprecatedtimezone",
90+
"$fuchsia_sdk_root/fidl:fuchsia.intl",
9191
"$fuchsia_sdk_root/pkg:async-loop",
9292
"$fuchsia_sdk_root/pkg:async-loop-default",
9393
"$fuchsia_sdk_root/pkg:inspect",
@@ -98,9 +98,7 @@ library_for_all_configs("libdart_vm") {
9898
]
9999
} else {
100100
extra_deps = [
101-
# TODO(US-399): Remove time_service specific code when it is no longer
102-
# necessary.
103-
"//sdk/fidl/fuchsia.deprecatedtimezone",
101+
"//sdk/fidl/fuchsia.intl",
104102
"//sdk/lib/sys/cpp",
105103
"//sdk/lib/sys/inspect/cpp",
106104
"//zircon/public/lib/fbl",

0 commit comments

Comments
 (0)