blob: 798a0e94ce304714625187ecdacf1ae8884acd06 [file] [log] [blame]
// 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.
// @dart = 2.9
// Regression test for dart2js that used to remove the a B type check
// after an A type check, because it thought any subtype of A had to be B.
import "package:expect/expect.dart";
class A {}
class B extends A {}
main() {
var a = [new A(), new B()];
var b = a[0];
b = b as A;
Expect.throwsTypeError(() => b as B);
}