diff --git a/LanguageFeatures/nnbd/weak/overriding/override_checking_A01_opted_in_lib.dart b/LanguageFeatures/nnbd/weak/overriding/override_checking_A01_opted_in_lib.dart index ccdf224ab9..9de70c1e70 100644 --- a/LanguageFeatures/nnbd/weak/overriding/override_checking_A01_opted_in_lib.dart +++ b/LanguageFeatures/nnbd/weak/overriding/override_checking_A01_opted_in_lib.dart @@ -4,17 +4,14 @@ /// @author iarkh@unipro.ru -// TODO(https://github.com/dart-lang/sdk/issues/51557): Decide if the mixins -// being applied in this test should be "mixin", "mixin class" or the test -// should be left at 2.19. -// @dart=2.19 +// SharedOptions=--enable-experiment=class-modifiers library override_opted_in_lib; import "dart:async"; import "../../../../Utils/expect.dart"; -class OPTED_NULLABLE_ARGS { +mixin class OPTED_NULLABLE_ARGS { void test_int (int? i ) { Expect.fail("This method should be overriden"); } void test_object (Object? o ) { Expect.fail("This method should be overriden"); } void test_dynamic (dynamic i ) { Expect.fail("This method should be overriden"); } @@ -23,23 +20,23 @@ class OPTED_NULLABLE_ARGS { void test_futureOr(FutureOr i ) { Expect.fail("This method should be overriden"); } } -class OPTED_NONNULLABLE_ARGS { +mixin class OPTED_NONNULLABLE_ARGS { void test_int (int i ) { Expect.fail("This method should be overriden"); } void test_object (Object o ) { Expect.fail("This method should be overriden"); } void test_function(Function f ) { Expect.fail("This method should be overriden"); } void test_futureOr(FutureOr i) { Expect.fail("This method should be overriden"); } } -class OPTED_NEVER_ARGS { +mixin class OPTED_NEVER_ARGS { void test_never(Never n) { Expect.fail("This method should be overriden"); } } -class OPTED_REQUIRED_ARGS { +mixin class OPTED_REQUIRED_ARGS { void test_required_nonnullable({required int i}) { Expect.fail("This method should be overriden"); } void test_required_nullable ({required int? i}) { Expect.fail("This method should be overriden"); } } -class OPTED_NULLABLE_FIELD { +mixin class OPTED_NULLABLE_FIELD { int? i; Object? o; dynamic d; @@ -51,18 +48,18 @@ class OPTED_NULLABLE_FIELD { void testme() {} -class OPTED_NONNULLABLE_FIELD { +mixin class OPTED_NONNULLABLE_FIELD { int i = 0; Object o = 0; Function f = testme; FutureOr fi = 0; } -class OPTED_NEVER_FIELD { +mixin class OPTED_NEVER_FIELD { Never n = throw "Cannot reach here"; } -class OPTED_NULLABLE_GETTER { +mixin class OPTED_NULLABLE_GETTER { int? get getInt => throw("This method should be overriden"); Object? get getObject => throw("This method should be overriden"); dynamic get getDynamic => throw("This method should be overriden"); @@ -71,18 +68,18 @@ class OPTED_NULLABLE_GETTER { FutureOr get getFutureOr => throw("This method should be overriden"); } -class OPTED_NONNULLABLE_GETTER { +mixin class OPTED_NONNULLABLE_GETTER { int get getInt => throw("This method should be overriden"); Object get getObject => throw("This method should be overriden"); Function get getFunction => throw("This method should be overriden"); FutureOr get getFutureOrInt => throw("This method should be overriden"); } -class OPTED_NEVER_GETTER { +mixin class OPTED_NEVER_GETTER { Never get getNever => throw("This method should be overriden"); } -class OPTED_NULLABLE_SETTER { +mixin class OPTED_NULLABLE_SETTER { void set setInt (int? i) { Expect.fail("This method should be overriden"); } void set setObject (Object? o) { Expect.fail("This method should be overriden"); } void set setDynamic (dynamic d) { Expect.fail("This method should be overriden"); } @@ -91,18 +88,18 @@ class OPTED_NULLABLE_SETTER { void set setFutureOr(FutureOr f) { Expect.fail("This method should be overriden"); } } -class OPTED_NONNULLABLE_SETTER { +mixin class OPTED_NONNULLABLE_SETTER { void set setInt (int i ) { Expect.fail("This method should be overriden"); } void set setObject (Object o ) { Expect.fail("This method should be overriden"); } void set setFunction (Function f ) { Expect.fail("This method should be overriden"); } void set setFutureOrInt(FutureOr i) { Expect.fail("This method should be overriden"); } } -class OPTED_NEVER_SETTER { +mixin class OPTED_NEVER_SETTER { void set setNever(Never n) { Expect.fail("This method should be overriden"); } } -class OPTED_NULLABLE_RETURN { +mixin class OPTED_NULLABLE_RETURN { int? getInt() => throw("This method should be overriden"); Object? getObject() => throw("This method should be overriden"); dynamic getDynamic() => throw("This method should be overriden"); @@ -111,26 +108,26 @@ class OPTED_NULLABLE_RETURN { FutureOr getFutureOr() => throw("This method should be overriden"); } -class OPTED_NONNULLABLE_RETURN { +mixin class OPTED_NONNULLABLE_RETURN { int getInt() => throw("This method should be overriden"); Object getObject() => throw("This method should be overriden"); Function getFunction() => throw("This method should be overriden"); FutureOr getFutureOrInt() => throw("This method should be overriden"); } -class OPTED_NEVER_RETURN { +mixin class OPTED_NEVER_RETURN { Never getNever() => throw("This method should be overriden"); } -class OPTED_NONNULLABLE_INT {} -class OPTED_NONNULLABLE_OBJECT {} -class OPTED_NONNULLABLE_FUNCTION {} +mixin class OPTED_NONNULLABLE_INT {} +mixin class OPTED_NONNULLABLE_OBJECT {} +mixin class OPTED_NONNULLABLE_FUNCTION {} -class OPTED_NULLABLE {} -class OPTED_DYNAMIC {} -class OPTED_NULLABLE_INT {} -class OPTED_NULLABLE_OBJECT {} -class OPTED_NULLABLE_FUNCTION {} -class OPTED_NULL {} +mixin class OPTED_NULLABLE {} +mixin class OPTED_DYNAMIC {} +mixin class OPTED_NULLABLE_INT {} +mixin class OPTED_NULLABLE_OBJECT {} +mixin class OPTED_NULLABLE_FUNCTION {} +mixin class OPTED_NULL {} -class OPTED_NEVER {} +mixin class OPTED_NEVER {}