blob: bee83a6f54a78a582544563d1c8aa7b332d2f81a [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 When tearing off a constructor of a generic class using [C.name],
/// the type arguments may be implicitly instantiated, just as for a normal
/// generic method tear-off of the corresponding static function. The
/// instantiation is based on the context-type at the tear-off position. If the
/// context types allows a generic function, the tear-off is not instantiated
/// and the result is a generic function.
///
/// @description Checks that type arguments can be implicitly instantiated.
/// @author iarkh@unipro.ru
import "../../Utils/expect.dart";
class C<T1, T2 extends num, T3 extends String> {
C.constr() {}
C.constr1(T1 t, T2 t2) {}
}
main() {
Expect.isTrue(C.constr is C Function<T1 extends dynamic, T2 extends num, T3 extends String>());
Expect.isTrue(C.constr1 is C Function<T1 extends dynamic, T2 extends num, T3 extends String>(T1, T2));
}