Files
sdk/pkg/front_end/testcases/general/issue45204.dart
T
Dmitry Stefantsov d6b79dab6c [cfe] Correct argument count in extension member errors
Closes #45204.

Bug: https://github.com/dart-lang/sdk/issues/45204
Change-Id: I5295704a8d470e639fe346dbbbf80ad28ff614a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190520
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-03-15 10:46:00 +00:00

45 lines
799 B
Dart

// Copyright (c) 2021, 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.
extension S on int {
void test(int x) {}
}
extension S2<X> on int {
void test2(int x) {}
void test3<Y>(Y y) {}
}
foo() {
3.test();
4.test(5, 6);
5.test<int>(6);
3.test2();
4.test2(5, 6);
5.test2<int>(6);
3.test3();
4.test3(5, 6);
5.test3<int>(6);
6.test3<int, int>(7);
7.test3<int, int, int>(8);
S(3).test();
S(4).test(5, 6);
S(5).test<int>(6);
S2(3).test2();
S2(4).test2(5, 6);
S2(5).test2<int>(6);
S2(3).test3();
S2(4).test3(5, 6);
S2(5).test3<int>(6);
S2(6).test3<int, int>(7);
S2(7).test3<int, int, int>(8);
}
main() {}