// Copyright (c) 2024, 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 Base { T1? t1; T2? t2; Base() { print('Base: $T1, $T2'); } } class A extends Base { A(String s); } class B extends Base, String> { B() { print('B: $T'); } } class C { C(String s) { print('C: $s'); } } foo1() => new C('hello'); void foo2() { new A('hi'); new B(); } void foo3() { new B>(); } class E { testReuse1() => new Map(); } class F extends E> { testReuse2() => new Map>(); } class G { G(); factory G.testFactory() => new H(); } class H extends G {} void foo4() { new G>.testFactory(); } class I { I(param); factory I.testFactory2({param}) => new I(param); } void foo5() { new I.testFactory2(); new I.testFactory2(param: 42); } class J { J._(); factory J() => J._(); } abstract class L { factory L() => new TestTypeArgReuse(); } class TestTypeArgReuse extends Base implements L {} foo6() => List.empty(); foo7(int n) => List.filled(n, 0); main() { foo1(); foo2(); foo3(); }