blob: c16111ab5d95e30ee3acd6c601d4596bfa29cd70 [file] [log] [blame] [edit]
// Copyright (c) 2025, 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.
class Arg {}
abstract class Base<T> {
void foo(T a);
}
class A extends Base<Arg> {
@override
void foo(Arg a, [String? b]) {
print(a);
print(b);
}
}
class B extends A {
@override
void foo(Arg a, [String? b, int c = 0]) {
print(a);
print(b);
print(c);
}
}
void check(void Function(Arg) closure) {
closure(Arg());
}
void main() {
final closure = A().foo;
check(closure);
B().foo(Arg(), 'b', 3);
}