Files
sdk/tests/language/instance/call_wrong_argument_count_test.dart
T
Robert Nystrom 7134a451f3 Format tests/language/i*.
A lot of files in this one, but nothing interesting in any of the tests.

Change-Id: I69c705bfd2c2b2f9711b393e4ac78c357336e1a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/407660
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2025-02-05 08:36:21 -08:00

22 lines
633 B
Dart

// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/// Test mismatch in argument counts.
class Niederhorn {
int goodCall(int a, int b, int c) {
return a + b;
}
}
main() {
var niederhorn = Niederhorn();
niederhorn.goodCall(1, 2, 3);
niederhorn.goodCall(1, 2, 3, 4);
// ^
// [cfe] Too many positional arguments: 3 allowed, but 4 found.
// ^
// [analyzer] COMPILE_TIME_ERROR.EXTRA_POSITIONAL_ARGUMENTS
}