dart-sdk/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_04_test.dart
Lasse R.H. Nielsen 46ceec41d2 Remove references to enabled nonfunction-type-aliases experiment.
Change-Id: I0cfd2ad9e59c985f632d7038a64d903f6b472dd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199480
Auto-Submit: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2021-05-17 13:17:20 +00:00

26 lines
533 B
Dart

// Copyright (c) 2020, 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.
import 'package:expect/expect.dart';
class C<X> {
factory C(Type t) => D<X>(t);
}
class D<X> implements C<X> {
D(Type t) {
Expect.equals(t, X);
}
}
typedef T<X> = C<List<X>>;
Type typeOf<X>() => X;
void main() {
T<num> x1 = T(typeOf<List<num>>());
C<Iterable<num>> x2 = T(typeOf<List<num>>());
}