blob: f93ca3e4dfae41b5c47a8c6a286d9d2a74cf2a8e [file] [log] [blame]
// Copyright (c) 2015, 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.
// @dart = 2.9
import 'dart:mirrors';
import 'package:expect/expect.dart';
abstract class A<T> {
get t;
factory A() = B<T, A<T>>;
}
class B<X, Y> implements A<X> {
final t;
B() : t = Y;
}
main() {
ClassMirror m = reflectClass(A);
var i = m.newInstance(Symbol.empty, []).reflectee;
var s = i.t.toString();
Expect.isTrue(s == 'A' || s == 'A<dynamic>',
'mirrors should create the correct reified generic type');
}