blob: c7bb621fc21427b51763bf2dd128b19459570737 [file] [log] [blame]
// 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.
/// @assertion Similarly, [params] is almost exactly the same parameter list
/// as the constructor [C.name], with the one exception that initializing
/// formals are represented by normal parameters with the same name and type.
/// All remaining properties of the parameters are the same as for the
/// corresponding constructor parameter, including any default values, and
/// [args] is an argument list passing those parameters to [C.name] directly as
/// they are received.
///
/// @description Checks statically that [params] is exactly the same parameter
/// list - test case with one [int] argument.
/// @author iarkh@unipro.ru
// SharedOptions=--enable-experiment=constructor-tearoffs
class C {
C.constr(num i) {}
}
main() {
C Function(num) v = C.constr;
C Function(int) v1 = C.constr;
C Function() v2 = C.constr;
// ^
// [analyzer] unspecified
// [cfe] unspecified
C Function(dynamic) v3 = C.constr;
// ^
// [analyzer] unspecified
// [cfe] unspecified
C Function(Object) v4 = C.constr;
// ^
// [analyzer] unspecified
// [cfe] unspecified
C Function(Object?) v5 = C.constr;
// ^
// [analyzer] unspecified
// [cfe] unspecified
C Function(String) v6 = C.constr;
// ^
// [analyzer] unspecified
// [cfe] unspecified
C Function(num, int) v7 = C.constr;
// ^
// [analyzer] unspecified
// [cfe] unspecified
C Function(Never) v8 = C.constr;
// ^
// [analyzer] unspecified
// [cfe] unspecified
C Function(Null) v9 = C.constr;
// ^
// [analyzer] unspecified
// [cfe] unspecified
}