// Copyright (c) 2012, 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 test program for testing the instanceof operation. // Tests involving generics. abstract class I { } class A implements I { } class B implements I { } abstract class K { } abstract class L extends K { } class C implements L { } class D implements B { } main() { var a = new A(); var b = new B(); var c = new C(); var d = new D(); // Repeat type checks so that inlined tests can be tested as well. for (int i = 0; i < 5; i++) { Expect.isFalse(a is I); Expect.isTrue(a is I); Expect.isFalse(b is I); Expect.isFalse(c is K); Expect.isFalse(c is K); Expect.isTrue(c is L); Expect.isFalse(c is L); Expect.isTrue(c is K); Expect.isFalse(c is K); Expect.isFalse(d is I); Expect.isTrue(d is I); } }