blob: 98a4c9abdc69c4f93545cf2142b21005f7e8a064 [file] [log] [blame]
// 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.
/// @assertion An extension can declare a member with the same (base-)name as a
/// member of the type it is declared on. This does not cause a compile-time
/// conflict, even if the member does not have a compatible signature.
///
/// @description Check that it is no compile error if an extension declares a
/// member with the same (base-)name as a member of the type it is declared on
/// but with the different arguments (but it is a compile error if we try to call
/// it)
/// @author sgrekhov@unipro.ru
extension ExtendedList<T> on List<T> {
void add(T val, {int count = 1}) {
}
}
main() {
List<String> list = ["Lily", "was"];
list.add("here", count: 2);
// ^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}