Files
sdk/pkg/front_end/testcases/nnbd/forbidden_supers.dart
T
Dmitry Stefantsov d370cabc5e [cfe] Report errors on supertypes marked with "?"
Closes #40087.

Bug: http://dartbug.com/40087
Change-Id: I3b44472f3a778e44a648b0ffd4a5c704b6f4d0c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133220
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2020-01-24 12:50:09 +00:00

55 lines
1.1 KiB
Dart

// 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.
// This test checks for compile-time errors in cases when either Never or T? is
// extended, implemented, or mixed in, where T is a type.
class Aoo {}
class Boo {}
class Coo extends Boo with Aoo? {}
class Doo extends Aoo? {}
class Eoo implements Boo? {}
class Foo extends Boo? with Aoo {}
class Goo = Boo? with Aoo?;
class Hoo extends Object with Aoo implements Boo? {}
class Ioo = Object with Aoo implements Boo?;
class Joo extends Boo with Never {}
class Koo extends Never {}
class Loo implements Never {}
mixin Moo1 on Aoo? implements Boo? {}
mixin Moo2 on Aoo?, Boo? {}
mixin Moo3 implements Aoo?, Boo? {}
mixin Moo4 on Aoo implements Never {}
mixin Moo5 on Aoo, Never {}
mixin Moo6 on Never {}
mixin Moo7 implements Aoo, Never {}
mixin Moo8 implements Never {}
class Noo = Never with Aoo;
class NooDynamic = dynamic with Aoo;
class NooVoid = void with Aoo;
class Ooo = Aoo with Never;
main() {}