Files
sdk/tests/language/null/inherit_static_errors_test.dart
Lasse R.H. Nielsen 5430e68680 Remove unnecessary leftover @dart=2.19 from tests.
Change-Id: I6d5e15ff2d432202618fbc490969a65a9181816d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396281
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2024-11-28 09:10:30 +00:00

42 lines
2.1 KiB
Dart

// Copyright (c) 2022, 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 BadExtends extends Null {}
// ^
// [cfe] 'Null' is restricted and can't be extended or implemented.
// [cfe] Subtypes of deeply immutable classes must be deeply immutable.
// [cfe] The superclass, 'Null', has no unnamed constructor that takes no arguments.
// ^^^^
// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
// [cfe] 'Null' is restricted and can't be extended or implemented.
// [cfe] The class 'Null' can't be extended outside of its library because it's a final class.
class BadImplements implements Null {}
// ^
// [cfe] 'Null' is restricted and can't be extended or implemented.
// [cfe] Subtypes of deeply immutable classes must be deeply immutable.
// ^^^^
// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
// [cfe] 'Null' is restricted and can't be extended or implemented.
// [cfe] The class 'Null' can't be implemented outside of its library because it's a final class.
class BadMixin extends Object with Null {}
// ^
// [cfe] 'Null' is restricted and can't be extended or implemented.
// [cfe] Subtypes of deeply immutable classes must be deeply immutable.
// [cfe] The type 'BadMixin' must be 'base', 'final' or 'sealed' because the supertype 'Null' is 'final'.
// ^^^^
// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
// [cfe] 'Null' is restricted and can't be extended or implemented.
// [cfe] The class 'Null' can't be used as a mixin because it isn't a mixin class nor a mixin.
class BadMixin2 = Object with Null;
// ^
// [cfe] 'Null' is restricted and can't be extended or implemented.
// [cfe] Subtypes of deeply immutable classes must be deeply immutable.
// ^^^^
// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
// [cfe] 'Null' is restricted and can't be extended or implemented.
// [cfe] The class 'Null' can't be used as a mixin because it isn't a mixin class nor a mixin.