dart-sdk/tests/language_2/mixin_mixin7_test.dart

37 lines
785 B
Dart
Raw Normal View History

2015-09-16 20:28:49 +00:00
// Copyright (c) 2013, 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 I<T> {}
2015-09-16 20:28:49 +00:00
class J<T> {}
2015-09-16 20:28:49 +00:00
class K<T> {}
2015-09-16 20:28:49 +00:00
class S<T> {}
2015-09-16 20:28:49 +00:00
class M<T> {
m() {
return T;
}
2015-09-16 20:28:49 +00:00
}
class A<U, V> = Object with M implements I<V>; // M is raw.
2015-09-16 20:28:49 +00:00
class B<T> = Object with A implements J<T>; // A is raw.
2015-09-16 20:28:49 +00:00
class C<T> = S<List<T>> with B implements K<T>; // B is raw.
2015-09-16 20:28:49 +00:00
main() {
var c = new C<int>();
Expect.equals("dynamic", c.m().toString());
Expect.isTrue(c is K<int>);
Expect.isTrue(c is J);
Expect.isTrue(c is I);
Expect.isTrue(c is S<List<int>>);
Expect.isTrue(c is A);
Expect.isTrue(c is M);
}