dart-sdk/tests/language_2/mixin_type_parameter1_test.dart
pq d9326f4ab3 Migrate test block 135 to Dart 2.0.
Bug:
Change-Id: Icda59de9bfad2e9b2683f019fb9c6fc54c12547c
Reviewed-on: https://dart-review.googlesource.com/7587
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2017-09-22 17:04:06 +00:00

24 lines
612 B
Dart

// 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";
abstract class Mixin1<T> {}
abstract class Mixin2<T> {}
class A {}
class MyTypedef<K, V> = A with Mixin1<K>, Mixin2<V>;
class B<K, V> extends MyTypedef<K, V> {}
main() {
var b = new B<num, String>();
Expect.isTrue(b is Mixin1<num>);
Expect.isTrue(b is! Mixin1<String>);
Expect.isTrue(b is Mixin2<String>);
Expect.isTrue(b is! Mixin2<num>);
}