blob: 403c04d7f81d86e95b053d7b0a3c387679f03c79 [file] [log] [blame]
// Copyright (c) 2020, 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.
class A {}
class B extends A {}
m() {
var v;
{
A? a;
v = a as B; // LINT
}
{
A? a;
v = a as B?; // OK
}
{
A? a;
v = a as A; // LINT
}
// exclude dynamic
{
dynamic b;
v = b as B; // OK
}
{
dynamic b;
v = b as B?; // OK
}
}