diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f38c984436..2b45903862a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,18 +16,6 @@ ### Libraries -#### General changes - -- **Breaking Change**: Non-`mixin` classes in the platform libraries - can no longer be mixed in, unless they are explicitly marked as `mixin class`. - The following existing classes have been made mixin classes: - * `IterableMixin` - * `ListMixin` - * `SetMixin` - * `MapMixin` - * `LinkedListEntry` - * `StringConversionSink` - #### `dart:core` - **Breaking change** [#49529][]: @@ -60,15 +48,6 @@ Existing bidirectional iterators can still work, they just don't have a shared supertype locking them to a specific name for moving backwards. -- **Breaking change when migrating code to Dart 3.0**: - Some changes to platform libraries only affect code when it is migrated - to language version 3.0. - - The `Function` type can no longer be implemented. - Since Dart 2.0 writing `implements Function` has been allowed - for backwards compatibility, but it has not had any effect. - In Dart 3.0, the `Function` type is `final` and cannot be implemented - by class-modifier aware code. - [#49529]: https://github.com/dart-lang/sdk/issues/49529 [`List.filled`]: https://api.dart.dev/stable/2.18.6/dart-core/List/List.filled.html [`int.parse`]: https://api.dart.dev/stable/2.18.4/dart-core/int/parse.html @@ -170,14 +149,14 @@ Updates the Linter to `1.34.0-dev`, which includes changes that - `prefer_equal_for_default_values` - `super_goes_last` - fix `unnecessary_parenthesis` false-positives with null-aware expressions. -- fix `void_checks` to allow assignments of `Future?` to parameters +- fix `void_checks` to allow assignments of `Future?` to parameters typed `FutureOr?`. - fix `use_build_context_synchronously` in if conditions. - fix a false positive for `avoid_private_typedef_functions` with generalized type aliases. - update `unnecessary_parenthesis` to detect some doubled parens. - update `void_checks` to allow returning `Never` as void. -- update `no_adjacent_strings_in_list` to support set literals and for- and +- update `no_adjacent_strings_in_list` to support set literals and for- and if-elements. - update `avoid_types_as_parameter_names` to handle type variables. - update `avoid_positional_boolean_parameters` to handle typedefs. diff --git a/pkg/analysis_server/test/verify_sorted_test.dart b/pkg/analysis_server/test/verify_sorted_test.dart index 827cba32914..cb8675d90a6 100644 --- a/pkg/analysis_server/test/verify_sorted_test.dart +++ b/pkg/analysis_server/test/verify_sorted_test.dart @@ -71,7 +71,7 @@ void buildTestsForAnalysisServer() { 'lib/src/edit/nnbd_migration/resources/resources.g.dart', 'test/integration/support/integration_test_methods.dart', 'test/integration/support/protocol_matchers.dart', - // The following are not generated, but can't be sorted because they contain + // The following are not generated, but can't be sorted because the contain // ignore comments in the directives, which sorting deletes. 'lib/src/edit/edit_domain.dart', 'lib/src/services/kythe/schema.dart', diff --git a/pkg/analyzer/lib/src/dart/analysis/experiments.g.dart b/pkg/analyzer/lib/src/dart/analysis/experiments.g.dart index 51d5defc2f3..69bb459c28c 100644 --- a/pkg/analyzer/lib/src/dart/analysis/experiments.g.dart +++ b/pkg/analyzer/lib/src/dart/analysis/experiments.g.dart @@ -140,7 +140,7 @@ class ExperimentalFeatures { isEnabledByDefault: IsEnabledByDefault.class_modifiers, isExpired: IsExpired.class_modifiers, documentation: 'Class modifiers', - experimentalReleaseVersion: Version.parse('3.0.0'), + experimentalReleaseVersion: null, releaseVersion: null, ); @@ -314,7 +314,7 @@ class ExperimentalFeatures { isEnabledByDefault: IsEnabledByDefault.records, isExpired: IsExpired.records, documentation: 'Records', - experimentalReleaseVersion: Version.parse('3.0.0'), + experimentalReleaseVersion: Version.parse('2.19.0'), releaseVersion: null, ); @@ -324,7 +324,7 @@ class ExperimentalFeatures { isEnabledByDefault: IsEnabledByDefault.sealed_class, isExpired: IsExpired.sealed_class, documentation: 'Sealed class', - experimentalReleaseVersion: Version.parse('3.0.0'), + experimentalReleaseVersion: null, releaseVersion: null, ); diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart index ecfc95e3e44..1cd5a8eb9c9 100644 --- a/pkg/analyzer/lib/src/generated/error_verifier.dart +++ b/pkg/analyzer/lib/src/generated/error_verifier.dart @@ -1746,10 +1746,7 @@ class ErrorVerifier extends RecursiveAstVisitor final interfaceElement = interfaceType.element; if (interfaceElement is ClassOrMixinElementImpl && interfaceElement.isBase && - interfaceElement.library != _currentLibrary && - !_mayIgnoreClassModifiers(interfaceElement.library)) { - // Should this be combined with _checkForImplementsClauseErrorCodes - // to avoid double errors if implementing `int`. + interfaceElement.library != _currentLibrary) { if (interfaceElement is ClassElement) { errorReporter.reportErrorForNode( CompileTimeErrorCode.BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, @@ -2865,8 +2862,7 @@ class ErrorVerifier extends RecursiveAstVisitor final element = type.element; if (element is ClassElementImpl && element.isFinal && - element.library != _currentLibrary && - !_mayIgnoreClassModifiers(element.library)) { + element.library != _currentLibrary) { errorReporter.reportErrorForNode( CompileTimeErrorCode.FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY, superclass, @@ -2881,8 +2877,7 @@ class ErrorVerifier extends RecursiveAstVisitor final element = type.element; if (element is MixinElementImpl && element.isFinal && - element.library != _currentLibrary && - !_mayIgnoreClassModifiers(element.library)) { + element.library != _currentLibrary) { errorReporter.reportErrorForNode( CompileTimeErrorCode.FINAL_MIXIN_MIXED_IN_OUTSIDE_OF_LIBRARY, namedType, @@ -2898,8 +2893,7 @@ class ErrorVerifier extends RecursiveAstVisitor final element = type.element; if (element is ClassOrMixinElementImpl && element.isFinal && - element.library != _currentLibrary && - !_mayIgnoreClassModifiers(element.library)) { + element.library != _currentLibrary) { final ErrorCode errorCode; if (element is ClassElement) { errorCode = CompileTimeErrorCode @@ -3119,8 +3113,7 @@ class ErrorVerifier extends RecursiveAstVisitor final superclassElement = superclassType.element; if (superclassElement is ClassElementImpl && superclassElement.isInterface && - superclassElement.library != _currentLibrary && - !_mayIgnoreClassModifiers(superclassElement.library)) { + superclassElement.library != _currentLibrary) { errorReporter.reportErrorForNode( CompileTimeErrorCode.INTERFACE_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY, superclass, @@ -3135,8 +3128,7 @@ class ErrorVerifier extends RecursiveAstVisitor final withElement = withType.element; if (withElement is MixinElementImpl && withElement.isInterface && - withElement.library != _currentLibrary && - !_mayIgnoreClassModifiers(withElement.library)) { + withElement.library != _currentLibrary) { errorReporter.reportErrorForNode( CompileTimeErrorCode .INTERFACE_MIXIN_MIXED_IN_OUTSIDE_OF_LIBRARY, @@ -5493,26 +5485,6 @@ class ErrorVerifier extends RecursiveAstVisitor return false; } - /// Checks whether a `final`, `base` or `interface` modifier can be ignored. - /// - /// Checks whether a subclass in the current library - /// can ignore a class modifier of a declaration in [superLibrary]. - /// - /// Only true if the supertype library is a platform library, and - /// either the current library is also a platform library, - /// or the current library has a language version which predates - /// class modifiers - bool _mayIgnoreClassModifiers(LibraryElement superLibrary) { - // Only modifiers in platform libraries can be ignored. - if (!superLibrary.isInSdk) return false; - - // Other platform libraries can ignore modifiers. - if (_currentLibrary.isInSdk) return true; - - // Libraries predating class modifiers can ignore platform modifiers. - return !_currentLibrary.featureSet.isEnabled(Feature.class_modifiers); - } - /// Return the name of the [parameter], or `null` if the parameter does not /// have a name. Token? _parameterName(FormalParameter parameter) { diff --git a/pkg/analyzer/lib/src/generated/source.dart b/pkg/analyzer/lib/src/generated/source.dart index 16f192c1795..ab917f2e9b8 100644 --- a/pkg/analyzer/lib/src/generated/source.dart +++ b/pkg/analyzer/lib/src/generated/source.dart @@ -66,7 +66,7 @@ class DartUriResolver extends UriResolver { /// /// @param uri the URI being tested /// @return `true` if the given URI is a `dart:` URI - static bool isDartUri(Uri uri) => uri.isScheme(DART_SCHEME); + static bool isDartUri(Uri uri) => DART_SCHEME == uri.scheme; } /// An implementation of an non-existing [Source]. diff --git a/pkg/front_end/lib/src/api_prototype/experimental_flags_generated.dart b/pkg/front_end/lib/src/api_prototype/experimental_flags_generated.dart index 91bd594ce61..c0df6f47e6d 100644 --- a/pkg/front_end/lib/src/api_prototype/experimental_flags_generated.dart +++ b/pkg/front_end/lib/src/api_prototype/experimental_flags_generated.dart @@ -771,8 +771,6 @@ final Map defaultExperimentalFlags = { const AllowedExperimentalFlags defaultAllowedExperimentalFlags = const AllowedExperimentalFlags(sdkDefaultExperiments: { ExperimentalFlag.records, - ExperimentalFlag.classModifiers, - ExperimentalFlag.sealedClass, }, sdkLibraryExperiments: {}, packageExperiments: { "async": { ExperimentalFlag.nonNullable, diff --git a/pkg/front_end/lib/src/fasta/source/source_loader.dart b/pkg/front_end/lib/src/fasta/source/source_loader.dart index 5ef49394b3b..c99837de96d 100644 --- a/pkg/front_end/lib/src/fasta/source/source_loader.dart +++ b/pkg/front_end/lib/src/fasta/source/source_loader.dart @@ -2159,56 +2159,6 @@ severity: $severity typeBuilder.libraryBuilder.library.languageVersion >= ExperimentalFlag.sealedClass.experimentEnabledVersion; - /// Set when we know whether this library can ignore class modifiers. - /// - /// The same decision applies to all declarations in the library, - /// so the value only needs to be computed once. - bool? isExempt; - - /// Whether the [cls] declaration can ignore (some) class modifiers. - /// - /// Checks whether the [cls] can ignore modifiers - /// from the [supertypeDeclaration]. - /// This is only possible if the supertype declaration comes - /// from a platform library (`dart:` URI scheme), - /// and then only if the library is another platform library which is - /// exempt from restrictions on extending otherwise sealed platform types, - /// or if the library is a pre-class-modifiers-feature language version - /// library. - bool mayIgnoreClassModifiers(ClassBuilder supertypeDeclaration) { - // Only use this to ignore `final`, `base`, and `interface`. - // Nobody can ignore `abstract`, `sealed` or `mixin`. - - // We already know the library cannot ignore modifiers. - if (isExempt == false) return false; - - // Exception only applies to platform libraries. - final LibraryBuilder superLibrary = supertypeDeclaration.libraryBuilder; - if (!superLibrary.importUri.isScheme("dart")) return false; - - // Remaining tests depend on the source library only, - // and the result can be cached. - if (isExempt == true) return true; - - final LibraryBuilder subLibrary = cls.libraryBuilder; - - // Some platform libraries may implement types like `int`, - // even if they are final. - if (subLibrary.mayImplementRestrictedTypes) { - isExempt = true; - return true; - } - // "Legacy" libraries may ignore `final`, `base` and `interface` - // from platform libraries. (But still cannot implement `int`.) - if (subLibrary.library.languageVersion < - ExperimentalFlag.classModifiers.experimentEnabledVersion) { - isExempt = true; - return true; - } - isExempt = false; - return false; - } - TypeDeclarationBuilder? unaliasDeclaration(TypeBuilder typeBuilder) { TypeDeclarationBuilder? typeDeclarationBuilder = typeBuilder.declaration; if (typeDeclarationBuilder is TypeAliasBuilder) { @@ -2231,9 +2181,7 @@ severity: $severity cls.libraryBuilder.origin != supertypeDeclaration.libraryBuilder.origin) { if (isClassModifiersEnabled(supertypeDeclaration)) { - if (supertypeDeclaration.isInterface && - !cls.isMixinDeclaration && - !mayIgnoreClassModifiers(supertypeDeclaration)) { + if (supertypeDeclaration.isInterface && !cls.isMixinDeclaration) { cls.addProblem( templateInterfaceClassExtendedOutsideOfLibrary .withArguments(supertypeDeclaration.fullNameForErrors), @@ -2242,8 +2190,7 @@ severity: $severity } else if (supertypeDeclaration.isFinal && // TODO(kallentu): Error case where the class has a singular on // clause. Change with the new spec changes. - !cls.isMixinDeclaration && - !mayIgnoreClassModifiers(supertypeDeclaration)) { + !cls.isMixinDeclaration) { cls.addProblem( templateFinalClassExtendedOutsideOfLibrary .withArguments(supertypeDeclaration.fullNameForErrors), @@ -2288,15 +2235,13 @@ severity: $severity if (cls.libraryBuilder.origin != mixedInTypeDeclaration.libraryBuilder.origin) { - if (mixedInTypeDeclaration.isInterface && - !mayIgnoreClassModifiers(mixedInTypeDeclaration)) { + if (mixedInTypeDeclaration.isInterface) { cls.addProblem( templateInterfaceMixinMixedInOutsideOfLibrary .withArguments(mixedInTypeDeclaration.fullNameForErrors), mixedInTypeBuilder.charOffset ?? TreeNode.noOffset, noLength); - } else if (mixedInTypeDeclaration.isFinal && - !mayIgnoreClassModifiers(mixedInTypeDeclaration)) { + } else if (mixedInTypeDeclaration.isFinal) { cls.addProblem( templateFinalMixinMixedInOutsideOfLibrary .withArguments(mixedInTypeDeclaration.fullNameForErrors), @@ -2331,8 +2276,7 @@ severity: $severity if (isClassModifiersEnabled(interfaceDeclaration)) { // Report an error for a class implementing a base class outside of // its library. - if (interfaceDeclaration.isBase && - !mayIgnoreClassModifiers(interfaceDeclaration)) { + if (interfaceDeclaration.isBase) { if (interfaceDeclaration.isMixinDeclaration) { cls.addProblem( templateBaseMixinImplementedOutsideOfLibrary @@ -2349,8 +2293,7 @@ severity: $severity } else if (interfaceDeclaration.isFinal && // TODO(kallentu): Error case where the class has multiple on // clauses. Change with the new spec changes. - !cls.cls.isAnonymousMixin && - !mayIgnoreClassModifiers(interfaceDeclaration)) { + !cls.cls.isAnonymousMixin) { if (interfaceDeclaration.isMixinDeclaration) { cls.addProblem( templateFinalMixinImplementedOutsideOfLibrary diff --git a/pkg/front_end/test/spell_checking_list_common.txt b/pkg/front_end/test/spell_checking_list_common.txt index 348a4763fe7..1a6792da50a 100644 --- a/pkg/front_end/test/spell_checking_list_common.txt +++ b/pkg/front_end/test/spell_checking_list_common.txt @@ -2601,7 +2601,6 @@ restored restores restrict restricted -restrictions restrictive result resulted diff --git a/pkg/front_end/testcases/records/type_record_as_supertype.dart.strong.expect b/pkg/front_end/testcases/records/type_record_as_supertype.dart.strong.expect index dde4888ef51..2c8af64e236 100644 --- a/pkg/front_end/testcases/records/type_record_as_supertype.dart.strong.expect +++ b/pkg/front_end/testcases/records/type_record_as_supertype.dart.strong.expect @@ -38,9 +38,9 @@ library /*isNonNullableByDefault*/; // pkg/front_end/testcases/records/type_record_as_supertype.dart:22:16: Error: 'RR' is restricted and can't be extended or implemented. // abstract class C2 with RR {} // Error. // ^ -// sdk/lib/core/record.dart:11:22: Context: This is the type denoted by the type alias. -// abstract final class Record {} -// ^ +// sdk/lib/core/record.dart:11:16: Context: This is the type denoted by the type alias. +// abstract class Record {} +// ^ // import self as self; import "dart:core" as core; diff --git a/pkg/front_end/testcases/records/type_record_as_supertype.dart.strong.transformed.expect b/pkg/front_end/testcases/records/type_record_as_supertype.dart.strong.transformed.expect index 091650a4824..1ace8f9e622 100644 --- a/pkg/front_end/testcases/records/type_record_as_supertype.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/records/type_record_as_supertype.dart.strong.transformed.expect @@ -38,9 +38,9 @@ library /*isNonNullableByDefault*/; // pkg/front_end/testcases/records/type_record_as_supertype.dart:22:16: Error: 'RR' is restricted and can't be extended or implemented. // abstract class C2 with RR {} // Error. // ^ -// sdk/lib/core/record.dart:11:22: Context: This is the type denoted by the type alias. -// abstract final class Record {} -// ^ +// sdk/lib/core/record.dart:11:16: Context: This is the type denoted by the type alias. +// abstract class Record {} +// ^ // import self as self; import "dart:core" as core; diff --git a/pkg/front_end/testcases/records/type_record_as_supertype.dart.weak.expect b/pkg/front_end/testcases/records/type_record_as_supertype.dart.weak.expect index dde4888ef51..2c8af64e236 100644 --- a/pkg/front_end/testcases/records/type_record_as_supertype.dart.weak.expect +++ b/pkg/front_end/testcases/records/type_record_as_supertype.dart.weak.expect @@ -38,9 +38,9 @@ library /*isNonNullableByDefault*/; // pkg/front_end/testcases/records/type_record_as_supertype.dart:22:16: Error: 'RR' is restricted and can't be extended or implemented. // abstract class C2 with RR {} // Error. // ^ -// sdk/lib/core/record.dart:11:22: Context: This is the type denoted by the type alias. -// abstract final class Record {} -// ^ +// sdk/lib/core/record.dart:11:16: Context: This is the type denoted by the type alias. +// abstract class Record {} +// ^ // import self as self; import "dart:core" as core; diff --git a/pkg/front_end/testcases/records/type_record_as_supertype.dart.weak.modular.expect b/pkg/front_end/testcases/records/type_record_as_supertype.dart.weak.modular.expect index dde4888ef51..2c8af64e236 100644 --- a/pkg/front_end/testcases/records/type_record_as_supertype.dart.weak.modular.expect +++ b/pkg/front_end/testcases/records/type_record_as_supertype.dart.weak.modular.expect @@ -38,9 +38,9 @@ library /*isNonNullableByDefault*/; // pkg/front_end/testcases/records/type_record_as_supertype.dart:22:16: Error: 'RR' is restricted and can't be extended or implemented. // abstract class C2 with RR {} // Error. // ^ -// sdk/lib/core/record.dart:11:22: Context: This is the type denoted by the type alias. -// abstract final class Record {} -// ^ +// sdk/lib/core/record.dart:11:16: Context: This is the type denoted by the type alias. +// abstract class Record {} +// ^ // import self as self; import "dart:core" as core; diff --git a/pkg/front_end/testcases/records/type_record_as_supertype.dart.weak.outline.expect b/pkg/front_end/testcases/records/type_record_as_supertype.dart.weak.outline.expect index 2d737577d86..f960292ee8b 100644 --- a/pkg/front_end/testcases/records/type_record_as_supertype.dart.weak.outline.expect +++ b/pkg/front_end/testcases/records/type_record_as_supertype.dart.weak.outline.expect @@ -38,9 +38,9 @@ library /*isNonNullableByDefault*/; // pkg/front_end/testcases/records/type_record_as_supertype.dart:22:16: Error: 'RR' is restricted and can't be extended or implemented. // abstract class C2 with RR {} // Error. // ^ -// sdk/lib/core/record.dart:11:22: Context: This is the type denoted by the type alias. -// abstract final class Record {} -// ^ +// sdk/lib/core/record.dart:11:16: Context: This is the type denoted by the type alias. +// abstract class Record {} +// ^ // import self as self; import "dart:core" as core; diff --git a/pkg/front_end/testcases/records/type_record_as_supertype.dart.weak.transformed.expect b/pkg/front_end/testcases/records/type_record_as_supertype.dart.weak.transformed.expect index 091650a4824..1ace8f9e622 100644 --- a/pkg/front_end/testcases/records/type_record_as_supertype.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/records/type_record_as_supertype.dart.weak.transformed.expect @@ -38,9 +38,9 @@ library /*isNonNullableByDefault*/; // pkg/front_end/testcases/records/type_record_as_supertype.dart:22:16: Error: 'RR' is restricted and can't be extended or implemented. // abstract class C2 with RR {} // Error. // ^ -// sdk/lib/core/record.dart:11:22: Context: This is the type denoted by the type alias. -// abstract final class Record {} -// ^ +// sdk/lib/core/record.dart:11:16: Context: This is the type denoted by the type alias. +// abstract class Record {} +// ^ // import self as self; import "dart:core" as core; diff --git a/runtime/vm/json_test.cc b/runtime/vm/json_test.cc index 283ab38b7ec..8be27b39c58 100644 --- a/runtime/vm/json_test.cc +++ b/runtime/vm/json_test.cc @@ -182,7 +182,7 @@ ISOLATE_UNIT_TEST_CASE(JSON_JSONStream_DartObject) { "Class\",\"fixedId\":true,\"id\":\"\",\"name\":\"Null\",\"location\":{" "\"type\":\"SourceLocation\",\"script\":{\"type\":\"@Script\"," "\"fixedId\":true,\"id\":\"\",\"uri\":\"dart:core\\/null.dart\",\"_" - "kind\":\"kernel\"},\"tokenPos\":925,\"endTokenPos\":1171,\"line\":23," + "kind\":\"kernel\"},\"tokenPos\":925,\"endTokenPos\":1165,\"line\":23," "\"column\":1},\"library\":{" "\"type\":\"@Library\",\"fixedId\":true,\"id\":\"\",\"name\":\"dart." "core\",\"uri\":\"dart:core\"}},\"kind\":\"Null\",\"fixedId\":true," @@ -191,7 +191,7 @@ ISOLATE_UNIT_TEST_CASE(JSON_JSONStream_DartObject) { "\"fixedId\":true,\"id\":\"\",\"name\":\"Null\",\"location\":{\"type\":" "\"SourceLocation\",\"script\":{\"type\":\"@Script\",\"fixedId\":true," "\"id\":\"\",\"uri\":\"dart:core\\/null.dart\",\"_kind\":\"kernel\"}," - "\"tokenPos\":925,\"endTokenPos\":1171,\"line\":23,\"column\":1}," + "\"tokenPos\":925,\"endTokenPos\":1165,\"line\":23,\"column\":1}," "\"library\":{\"type\":\"@" "Library\",\"fixedId\":true,\"id\":\"\",\"name\":\"dart.core\",\"uri\":" "\"dart:core\"}},\"kind\":\"Null\",\"fixedId\":true,\"id\":\"\"," diff --git a/sdk/lib/_http/http_impl.dart b/sdk/lib/_http/http_impl.dart index 84c66327458..4b10469bfcb 100644 --- a/sdk/lib/_http/http_impl.dart +++ b/sdk/lib/_http/http_impl.dart @@ -289,7 +289,7 @@ class _HttpProfileData { int _nextServiceId = 1; // TODO(ajohnsen): Use other way of getting a unique id. -mixin _ServiceObject { +abstract class _ServiceObject { int __serviceId = 0; int get _serviceId { if (__serviceId == 0) __serviceId = _nextServiceId++; diff --git a/sdk/lib/_internal/allowed_experiments.json b/sdk/lib/_internal/allowed_experiments.json index 7b1568e07b3..6cdf7e4288e 100644 --- a/sdk/lib/_internal/allowed_experiments.json +++ b/sdk/lib/_internal/allowed_experiments.json @@ -2,9 +2,7 @@ "version": 1, "experimentSets": { "sdkExperiments": [ - "records", - "class-modifiers", - "sealed-class" + "records" ], "nullSafety": [ "non-nullable" diff --git a/sdk/lib/_internal/js_dev_runtime/patch/typed_data_patch.dart b/sdk/lib/_internal/js_dev_runtime/patch/typed_data_patch.dart index 78bfad35524..bf2ee83889d 100644 --- a/sdk/lib/_internal/js_dev_runtime/patch/typed_data_patch.dart +++ b/sdk/lib/_internal/js_dev_runtime/patch/typed_data_patch.dart @@ -333,7 +333,8 @@ class _UnmodifiableByteDataView implements ByteData, UnmodifiableByteDataView { } } -mixin _UnmodifiableListMixin, TD extends TypedData> { +abstract class _UnmodifiableListMixin, + TD extends TypedData> { L get _list; TD get _data => (_list as TD); diff --git a/sdk/lib/_internal/js_runtime/lib/typed_data_patch.dart b/sdk/lib/_internal/js_runtime/lib/typed_data_patch.dart index 78bfad35524..bf2ee83889d 100644 --- a/sdk/lib/_internal/js_runtime/lib/typed_data_patch.dart +++ b/sdk/lib/_internal/js_runtime/lib/typed_data_patch.dart @@ -333,7 +333,8 @@ class _UnmodifiableByteDataView implements ByteData, UnmodifiableByteDataView { } } -mixin _UnmodifiableListMixin, TD extends TypedData> { +abstract class _UnmodifiableListMixin, + TD extends TypedData> { L get _list; TD get _data => (_list as TD); diff --git a/sdk/lib/_internal/vm/lib/typed_data_patch.dart b/sdk/lib/_internal/vm/lib/typed_data_patch.dart index 8b0c8e72a67..c75a8c09b66 100644 --- a/sdk/lib/_internal/vm/lib/typed_data_patch.dart +++ b/sdk/lib/_internal/vm/lib/typed_data_patch.dart @@ -829,7 +829,7 @@ mixin _TypedDoubleListMixin> } } -mixin _Float32x4ListMixin implements List { +abstract class _Float32x4ListMixin implements List { int get elementSizeInBytes; int get offsetInBytes; _ByteBuffer get buffer; @@ -1187,7 +1187,7 @@ mixin _Float32x4ListMixin implements List { } } -mixin _Int32x4ListMixin implements List { +abstract class _Int32x4ListMixin implements List { int get elementSizeInBytes; int get offsetInBytes; _ByteBuffer get buffer; @@ -1544,7 +1544,7 @@ mixin _Int32x4ListMixin implements List { } } -mixin _Float64x2ListMixin implements List { +abstract class _Float64x2ListMixin implements List { int get elementSizeInBytes; int get offsetInBytes; _ByteBuffer get buffer; diff --git a/sdk/lib/async/future.dart b/sdk/lib/async/future.dart index 0b7de5e4ee5..dc002ccc1f6 100644 --- a/sdk/lib/async/future.dart +++ b/sdk/lib/async/future.dart @@ -36,10 +36,10 @@ part of dart.async; /// `Future`. @pragma("vm:entry-point") abstract class FutureOr { - // Private generative constructor, so that it is not subclassable, mixable, - // or instantiable. + // Private generative constructor, so that it is not subclassable, mixable, or + // instantiable. FutureOr._() { - throw new UnsupportedError("FutureOr cannot be instantiated"); + throw new UnsupportedError("FutureOr can't be instantiated"); } } diff --git a/sdk/lib/async/stream_controller.dart b/sdk/lib/async/stream_controller.dart index 4ea14605353..8ede57ee248 100644 --- a/sdk/lib/async/stream_controller.dart +++ b/sdk/lib/async/stream_controller.dart @@ -768,7 +768,7 @@ abstract class _StreamController implements _StreamControllerBase { } } -mixin _SyncStreamControllerDispatch +abstract class _SyncStreamControllerDispatch implements _StreamController, SynchronousStreamController { void _sendData(T data) { _subscription._add(data); @@ -783,7 +783,8 @@ mixin _SyncStreamControllerDispatch } } -mixin _AsyncStreamControllerDispatch implements _StreamController { +abstract class _AsyncStreamControllerDispatch + implements _StreamController { void _sendData(T data) { _subscription._addPending(_DelayedData(data)); } diff --git a/sdk/lib/collection/iterable.dart b/sdk/lib/collection/iterable.dart index 340c093bebf..864edd7826f 100644 --- a/sdk/lib/collection/iterable.dart +++ b/sdk/lib/collection/iterable.dart @@ -7,7 +7,7 @@ part of dart.collection; /// This [Iterable] mixin implements all [Iterable] members except `iterator`. /// /// All other methods are implemented in terms of `iterator`. -abstract mixin class IterableMixin implements Iterable { +abstract class IterableMixin implements Iterable { // This class has methods copied verbatim into: // - IterableBase // - SetMixin diff --git a/sdk/lib/collection/linked_list.dart b/sdk/lib/collection/linked_list.dart index bb5714fea6f..516deeebe05 100644 --- a/sdk/lib/collection/linked_list.dart +++ b/sdk/lib/collection/linked_list.dart @@ -270,7 +270,7 @@ class _LinkedListIterator> implements Iterator { /// linked list, and otherwise the `list` property is `null`. /// /// When created, an entry is not in any linked list. -abstract base mixin class LinkedListEntry> { +abstract class LinkedListEntry> { LinkedList? _list; E? _next; E? _previous; diff --git a/sdk/lib/collection/list.dart b/sdk/lib/collection/list.dart index d4e9a14f577..3cc50a682ba 100644 --- a/sdk/lib/collection/list.dart +++ b/sdk/lib/collection/list.dart @@ -69,7 +69,7 @@ abstract class ListBase extends Object with ListMixin { /// To avoid this, override 'add' and 'addAll' to also forward directly /// to the growable list, or, if possible, use `DelegatingList` from /// "package:collection/collection.dart" instead of a `ListMixin`. -abstract mixin class ListMixin implements List { +abstract class ListMixin implements List { // Iterable interface. // TODO(lrn): When we get composable mixins, reuse IterableMixin instead // of redeclaring everything. diff --git a/sdk/lib/collection/maps.dart b/sdk/lib/collection/maps.dart index b513f742edc..e4a9357aa59 100644 --- a/sdk/lib/collection/maps.dart +++ b/sdk/lib/collection/maps.dart @@ -108,7 +108,7 @@ abstract class MapBase extends MapMixin { /// /// A more efficient implementation is usually possible by overriding /// some of the other members as well. -abstract mixin class MapMixin implements Map { +abstract class MapMixin implements Map { Iterable get keys; V? operator [](Object? key); operator []=(K key, V value); @@ -263,7 +263,7 @@ class _MapBaseValueIterator implements Iterator { /// Mixin that overrides mutating map operations with implementations that /// throw. -mixin _UnmodifiableMapMixin implements Map { +abstract class _UnmodifiableMapMixin implements Map { /// This operation is not supported by an unmodifiable map. void operator []=(K key, V value) { throw UnsupportedError("Cannot modify unmodifiable map"); diff --git a/sdk/lib/collection/set.dart b/sdk/lib/collection/set.dart index cff8b071601..1ba001fbb93 100644 --- a/sdk/lib/collection/set.dart +++ b/sdk/lib/collection/set.dart @@ -20,7 +20,7 @@ part of dart.collection; /// Implementations of `Set` using this mixin should consider also implementing /// `clear` in constant time. The default implementation works by removing every /// element. -abstract mixin class SetMixin implements Set { +abstract class SetMixin implements Set { // This class reimplements all of [IterableMixin]. // If/when Dart mixins get more powerful, we should just create a single // Mixin class from IterableMixin and the new methods of this class. @@ -341,7 +341,7 @@ abstract class _SetBase with SetMixin { Set toSet() => _newSet()..addAll(this); } -mixin _UnmodifiableSetMixin implements Set { +abstract class _UnmodifiableSetMixin implements Set { static Never _throwUnmodifiable() { throw UnsupportedError("Cannot change an unmodifiable set"); } diff --git a/sdk/lib/convert/json.dart b/sdk/lib/convert/json.dart index bf9ab6761ef..d85f75ea958 100644 --- a/sdk/lib/convert/json.dart +++ b/sdk/lib/convert/json.dart @@ -882,7 +882,7 @@ abstract class _JsonStringifier { /// [Map] objects using the specified indent value. /// /// Subclasses should implement [writeIndentation]. -mixin _JsonPrettyPrintMixin implements _JsonStringifier { +abstract class _JsonPrettyPrintMixin implements _JsonStringifier { int _indentLevel = 0; /// Add [indentLevel] indentations to the JSON output. diff --git a/sdk/lib/convert/string_conversion.dart b/sdk/lib/convert/string_conversion.dart index 5a310937f20..2315330aaa9 100644 --- a/sdk/lib/convert/string_conversion.dart +++ b/sdk/lib/convert/string_conversion.dart @@ -155,7 +155,7 @@ abstract class StringConversionSinkBase extends StringConversionSinkMixin {} /// This class provides a mixin for converters that need to accept String /// inputs. -abstract mixin class StringConversionSinkMixin implements StringConversionSink { +abstract class StringConversionSinkMixin implements StringConversionSink { void addSlice(String str, int start, int end, bool isLast); void close(); diff --git a/sdk/lib/core/bool.dart b/sdk/lib/core/bool.dart index 1f62168931a..a8c22c50e19 100644 --- a/sdk/lib/core/bool.dart +++ b/sdk/lib/core/bool.dart @@ -10,7 +10,7 @@ part of dart.core; /// It is a compile-time error for a class to attempt to extend or implement /// bool. @pragma("vm:entry-point") -final class bool { +class bool { /// Returns the boolean value of the environment declaration [name]. /// /// The boolean value of the declaration is `true` if the declared value is diff --git a/sdk/lib/core/double.dart b/sdk/lib/core/double.dart index 50cf34022c0..7124a58f04e 100644 --- a/sdk/lib/core/double.dart +++ b/sdk/lib/core/double.dart @@ -21,7 +21,7 @@ part of dart.core; /// * [num] the super class for [double]. /// * [Numbers](https://dart.dev/guides/language/numbers) in /// [A tour of the Dart language](https://dart.dev/guides/language/language-tour). -abstract final class double extends num { +abstract class double extends num { static const double nan = 0.0 / 0.0; static const double infinity = 1.0 / 0.0; static const double negativeInfinity = -infinity; diff --git a/sdk/lib/core/enum.dart b/sdk/lib/core/enum.dart index da81879b040..b40145381db 100644 --- a/sdk/lib/core/enum.dart +++ b/sdk/lib/core/enum.dart @@ -11,7 +11,7 @@ part of dart.core; /// Non-platform classes cannot implement, extend or /// mix in this class. @Since("2.14") -abstract final class Enum { +abstract class Enum { /// A numeric identifier for the enumerated value. /// /// The values of a single enumeration are numbered diff --git a/sdk/lib/core/function.dart b/sdk/lib/core/function.dart index 3427206bdd8..1e51f2b150c 100644 --- a/sdk/lib/core/function.dart +++ b/sdk/lib/core/function.dart @@ -101,7 +101,7 @@ part of dart.core; /// Function? maybeFun = Random().nextBool() ? fun : null; /// print(maybeFun?.call(1)); // Prints "1" or "null". /// ``` -abstract final class Function { +abstract class Function { /// Dynamically call [function] with the specified arguments. /// /// Acts the same as dynamically calling [function] with diff --git a/sdk/lib/core/int.dart b/sdk/lib/core/int.dart index 6cba9f33767..d463215a741 100644 --- a/sdk/lib/core/int.dart +++ b/sdk/lib/core/int.dart @@ -25,7 +25,7 @@ part of dart.core; /// * [num] the super class for [int]. /// * [Numbers](https://dart.dev/guides/language/numbers) in /// [A tour of the Dart language](https://dart.dev/guides/language/language-tour). -abstract final class int extends num { +abstract class int extends num { /// Returns the integer value of the given environment declaration [name]. /// /// The result is the same as would be returned by: diff --git a/sdk/lib/core/null.dart b/sdk/lib/core/null.dart index b417b506e30..eb7a006b890 100644 --- a/sdk/lib/core/null.dart +++ b/sdk/lib/core/null.dart @@ -21,7 +21,7 @@ part of dart.core; /// [...? e6] // spreads e6 into the list literal, unless e6 is null. /// ``` @pragma("vm:entry-point") -final class Null { +class Null { factory Null._uninstantiable() { throw UnsupportedError('class Null cannot be instantiated'); } diff --git a/sdk/lib/core/num.dart b/sdk/lib/core/num.dart index 98a841b6978..0b70f636692 100644 --- a/sdk/lib/core/num.dart +++ b/sdk/lib/core/num.dart @@ -15,7 +15,7 @@ part of dart.core; /// * [Numbers](https://dart.dev/guides/language/numbers) in /// [A tour of the Dart language](https://dart.dev/guides/language/language-tour). -sealed class num implements Comparable { +abstract class num implements Comparable { /// Test whether this value is numerically equal to `other`. /// /// If both operands are [double]s, they are equal if they have the same diff --git a/sdk/lib/core/record.dart b/sdk/lib/core/record.dart index dff882e9e23..aa48207819b 100644 --- a/sdk/lib/core/record.dart +++ b/sdk/lib/core/record.dart @@ -8,4 +8,4 @@ part of dart.core; /// /// The run-time type of a record object is a record type, and as such, a /// subtype of [Record]. -abstract final class Record {} +abstract class Record {} diff --git a/sdk/lib/core/string.dart b/sdk/lib/core/string.dart index 05716083894..b4c80788745 100644 --- a/sdk/lib/core/string.dart +++ b/sdk/lib/core/string.dart @@ -105,7 +105,7 @@ part of dart.core; /// * [RegExp] to work with regular expressions. /// * [Strings and regular expressions](https://dart.dev/guides/libraries/library-tour#strings-and-regular-expressions) @pragma('vm:entry-point') -abstract final class String implements Comparable, Pattern { +abstract class String implements Comparable, Pattern { /// Allocates a new string containing the specified [charCodes]. /// /// The [charCodes] can be both UTF-16 code units and runes. diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart index 12773675057..a88d2e7a764 100644 --- a/sdk/lib/html/dart2js/html_dart2js.dart +++ b/sdk/lib/html/dart2js/html_dart2js.dart @@ -5913,7 +5913,7 @@ class _CssStyleDeclarationSet extends Object with CssStyleDeclarationBase { // items in the MEMBERS set if you want that functionality. } -abstract mixin class CssStyleDeclarationBase { +abstract class CssStyleDeclarationBase { String getPropertyValue(String propertyName); void setProperty(String propertyName, String? value, [String? priority]); @@ -37899,7 +37899,7 @@ class _Html5NodeValidator implements NodeValidator { // 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. -abstract mixin class ImmutableListMixin implements List { +abstract class ImmutableListMixin implements List { // From Iterable<$E>: Iterator get iterator { // Note: NodeLists are not fixed size. And most probably length shouldn't diff --git a/sdk/lib/internal/list.dart b/sdk/lib/internal/list.dart index 327ba4d23f3..5815293e349 100644 --- a/sdk/lib/internal/list.dart +++ b/sdk/lib/internal/list.dart @@ -9,7 +9,7 @@ part of dart._internal; * * Intended to mix-in on top of [ListMixin] for fixed-length lists. */ -mixin FixedLengthListMixin { +abstract class FixedLengthListMixin { /** This operation is not supported by a fixed length list. */ set length(int newLength) { throw new UnsupportedError( @@ -84,7 +84,7 @@ mixin FixedLengthListMixin { * This mixin is intended to be mixed in on top of [ListMixin] on * unmodifiable lists. */ -mixin UnmodifiableListMixin implements List { +abstract class UnmodifiableListMixin implements List { /** This operation is not supported by an unmodifiable list. */ void operator []=(int index, E value) { throw new UnsupportedError("Cannot modify an unmodifiable list"); diff --git a/sdk/lib/io/service_object.dart b/sdk/lib/io/service_object.dart index 22797511938..9229bda608a 100644 --- a/sdk/lib/io/service_object.dart +++ b/sdk/lib/io/service_object.dart @@ -7,7 +7,7 @@ part of dart.io; int _nextServiceId = 1; // TODO(ajohnsen): Use other way of getting a unique id. -mixin _ServiceObject { +abstract class _ServiceObject { int __serviceId = 0; int get _serviceId { if (__serviceId == 0) __serviceId = _nextServiceId++; diff --git a/sdk/lib/typed_data/typed_data.dart b/sdk/lib/typed_data/typed_data.dart index 472f05fa176..7dce1129667 100644 --- a/sdk/lib/typed_data/typed_data.dart +++ b/sdk/lib/typed_data/typed_data.dart @@ -27,7 +27,7 @@ part "unmodifiable_typed_data.dart"; /// /// It is a compile-time error for a class to attempt to extend or implement /// ByteBuffer. -abstract final class ByteBuffer { +abstract class ByteBuffer { /// Returns the length of this byte buffer, in bytes. int get lengthInBytes; @@ -346,7 +346,7 @@ abstract final class ByteBuffer { /// /// It is a compile-time error for a class to attempt to extend or implement /// TypedData. -abstract final class TypedData { +abstract class TypedData { /// Returns the number of bytes in the representation of each element in this /// list. int get elementSizeInBytes; @@ -361,7 +361,7 @@ abstract final class TypedData { ByteBuffer get buffer; } -abstract final class _TypedIntList extends TypedData { +abstract class _TypedIntList extends TypedData { /// Returns the concatenation of this list and [other]. /// /// If other is also a typed-data integer list, the returned list will @@ -371,7 +371,7 @@ abstract final class _TypedIntList extends TypedData { List operator +(List other); } -abstract final class _TypedFloatList extends TypedData { +abstract class _TypedFloatList extends TypedData { /// Returns the concatenation of this list and [other]. /// /// If other is also a typed-data floating point number list, @@ -386,7 +386,7 @@ abstract final class _TypedFloatList extends TypedData { /// /// It is a compile-time error for a class to attempt to extend or implement /// Endian. -final class Endian { +class Endian { final bool _littleEndian; const Endian._(this._littleEndian); @@ -433,7 +433,7 @@ final class Endian { /// /// It is a compile-time error for a class to attempt to extend or implement /// ByteData. -abstract final class ByteData implements TypedData { +abstract class ByteData implements TypedData { /// Creates a [ByteData] of the specified length (in elements), all of /// whose bytes are initially zero. @pragma("vm:entry-point") @@ -719,7 +719,7 @@ abstract final class ByteData implements TypedData { /// /// It is a compile-time error for a class to attempt to extend or implement /// Int8List. -abstract final class Int8List implements List, _TypedIntList { +abstract class Int8List implements List, _TypedIntList { /// Creates an [Int8List] of the specified length (in elements), all of /// whose elements are initially zero. /// @@ -832,7 +832,7 @@ abstract final class Int8List implements List, _TypedIntList { /// /// It is a compile-time error for a class to attempt to extend or implement /// Uint8List. -abstract final class Uint8List implements List, _TypedIntList { +abstract class Uint8List implements List, _TypedIntList { /// Creates a [Uint8List] of the specified length (in elements), all of /// whose elements are initially zero. /// @@ -952,7 +952,7 @@ abstract final class Uint8List implements List, _TypedIntList { /// /// It is a compile-time error for a class to attempt to extend or implement /// Uint8ClampedList. -abstract final class Uint8ClampedList implements List, _TypedIntList { +abstract class Uint8ClampedList implements List, _TypedIntList { /// Creates a [Uint8ClampedList] of the specified length (in elements), all of /// whose elements are initially zero. /// @@ -1068,7 +1068,7 @@ abstract final class Uint8ClampedList implements List, _TypedIntList { /// /// It is a compile-time error for a class to attempt to extend or implement /// Int16List. -abstract final class Int16List implements List, _TypedIntList { +abstract class Int16List implements List, _TypedIntList { /// Creates an [Int16List] of the specified length (in elements), all of /// whose elements are initially zero. /// @@ -1193,7 +1193,7 @@ abstract final class Int16List implements List, _TypedIntList { /// /// It is a compile-time error for a class to attempt to extend or implement /// Uint16List. -abstract final class Uint16List implements List, _TypedIntList { +abstract class Uint16List implements List, _TypedIntList { /// Creates a [Uint16List] of the specified length (in elements), all /// of whose elements are initially zero. /// @@ -1319,7 +1319,7 @@ abstract final class Uint16List implements List, _TypedIntList { /// /// It is a compile-time error for a class to attempt to extend or implement /// Int32List. -abstract final class Int32List implements List, _TypedIntList { +abstract class Int32List implements List, _TypedIntList { /// Creates an [Int32List] of the specified length (in elements), all of /// whose elements are initially zero. /// @@ -1444,7 +1444,7 @@ abstract final class Int32List implements List, _TypedIntList { /// /// It is a compile-time error for a class to attempt to extend or implement /// Uint32List. -abstract final class Uint32List implements List, _TypedIntList { +abstract class Uint32List implements List, _TypedIntList { /// Creates a [Uint32List] of the specified length (in elements), all /// of whose elements are initially zero. /// @@ -1570,7 +1570,7 @@ abstract final class Uint32List implements List, _TypedIntList { /// /// It is a compile-time error for a class to attempt to extend or implement /// Int64List. -abstract final class Int64List implements List, _TypedIntList { +abstract class Int64List implements List, _TypedIntList { /// Creates an [Int64List] of the specified length (in elements), all of /// whose elements are initially zero. /// @@ -1695,7 +1695,7 @@ abstract final class Int64List implements List, _TypedIntList { /// /// It is a compile-time error for a class to attempt to extend or implement /// Uint64List. -abstract final class Uint64List implements List, _TypedIntList { +abstract class Uint64List implements List, _TypedIntList { /// Creates a [Uint64List] of the specified length (in elements), all /// of whose elements are initially zero. /// @@ -1822,7 +1822,7 @@ abstract final class Uint64List implements List, _TypedIntList { /// /// It is a compile-time error for a class to attempt to extend or implement /// Float32List. -abstract final class Float32List implements List, _TypedFloatList { +abstract class Float32List implements List, _TypedFloatList { /// Creates a [Float32List] of the specified length (in elements), all of /// whose elements are initially zero. /// @@ -1944,7 +1944,7 @@ abstract final class Float32List implements List, _TypedFloatList { /// /// It is a compile-time error for a class to attempt to extend or implement /// Float64List. -abstract final class Float64List implements List, _TypedFloatList { +abstract class Float64List implements List, _TypedFloatList { /// Creates a [Float64List] of the specified length (in elements), all of /// whose elements are initially zero. /// @@ -2062,7 +2062,7 @@ abstract final class Float64List implements List, _TypedFloatList { /// /// It is a compile-time error for a class to attempt to extend or implement /// Float32x4List. -abstract final class Float32x4List implements List, TypedData { +abstract class Float32x4List implements List, TypedData { /// Creates a [Float32x4List] of the specified length (in elements), /// all of whose elements are initially zero. /// @@ -2183,7 +2183,7 @@ abstract final class Float32x4List implements List, TypedData { /// /// For long lists, this implementation will be considerably more /// space- and time-efficient than the default [List] implementation. -abstract final class Int32x4List implements List, TypedData { +abstract class Int32x4List implements List, TypedData { /// Creates a [Int32x4List] of the specified length (in elements), /// all of whose elements are initially zero. /// @@ -2307,7 +2307,7 @@ abstract final class Int32x4List implements List, TypedData { /// /// It is a compile-time error for a class to attempt to extend or implement /// Float64x2List. -abstract final class Float64x2List implements List, TypedData { +abstract class Float64x2List implements List, TypedData { /// Creates a [Float64x2List] of the specified length (in elements), /// all of whose elements have all lanes set to zero. /// @@ -2430,7 +2430,7 @@ abstract final class Float64x2List implements List, TypedData { /// /// It is a compile-time error for a class to attempt to extend or implement /// Float32x4. -abstract final class Float32x4 { +abstract class Float32x4 { external factory Float32x4(double x, double y, double z, double w); external factory Float32x4.splat(double v); external factory Float32x4.zero(); @@ -2800,7 +2800,7 @@ abstract final class Float32x4 { /// /// Int32x4 stores 4 32-bit bit-masks in "lanes". /// The lanes are "x", "y", "z", and "w" respectively. -abstract final class Int32x4 { +abstract class Int32x4 { external factory Int32x4(int x, int y, int z, int w); external factory Int32x4.bool(bool x, bool y, bool z, bool w); external factory Int32x4.fromFloat32x4Bits(Float32x4 x); @@ -3154,7 +3154,7 @@ abstract final class Int32x4 { /// /// It is a compile-time error for a class to attempt to extend or implement /// Float64x2. -abstract final class Float64x2 { +abstract class Float64x2 { external factory Float64x2(double x, double y); external factory Float64x2.splat(double v); external factory Float64x2.zero(); diff --git a/sdk/lib/typed_data/unmodifiable_typed_data.dart b/sdk/lib/typed_data/unmodifiable_typed_data.dart index 9deba75c0b3..2569847410d 100644 --- a/sdk/lib/typed_data/unmodifiable_typed_data.dart +++ b/sdk/lib/typed_data/unmodifiable_typed_data.dart @@ -8,7 +8,7 @@ part of dart.typed_data; /// /// It is a compile-time error for a class to attempt to extend or implement /// UnmodifiableByteBufferView. -abstract final class UnmodifiableByteBufferView implements ByteBuffer { +abstract class UnmodifiableByteBufferView implements ByteBuffer { external factory UnmodifiableByteBufferView(ByteBuffer data); } @@ -16,7 +16,7 @@ abstract final class UnmodifiableByteBufferView implements ByteBuffer { /// /// It is a compile-time error for a class to attempt to extend or implement /// UnmodifiableByteDataView. -abstract final class UnmodifiableByteDataView implements ByteData { +abstract class UnmodifiableByteDataView implements ByteData { external factory UnmodifiableByteDataView(ByteData data); } @@ -24,7 +24,7 @@ abstract final class UnmodifiableByteDataView implements ByteData { /// /// It is a compile-time error for a class to attempt to extend or implement /// UnmodifiableUint8ListView. -abstract final class UnmodifiableUint8ListView implements Uint8List { +abstract class UnmodifiableUint8ListView implements Uint8List { external factory UnmodifiableUint8ListView(Uint8List list); } @@ -32,7 +32,7 @@ abstract final class UnmodifiableUint8ListView implements Uint8List { /// /// It is a compile-time error for a class to attempt to extend or implement /// UnmodifiableInt8ListView. -abstract final class UnmodifiableInt8ListView implements Int8List { +abstract class UnmodifiableInt8ListView implements Int8List { external factory UnmodifiableInt8ListView(Int8List list); } @@ -40,7 +40,7 @@ abstract final class UnmodifiableInt8ListView implements Int8List { /// /// It is a compile-time error for a class to attempt to extend or implement /// UnmodifiableUint8ClampedListView. -abstract final class UnmodifiableUint8ClampedListView implements Uint8ClampedList { +abstract class UnmodifiableUint8ClampedListView implements Uint8ClampedList { external factory UnmodifiableUint8ClampedListView(Uint8ClampedList list); } @@ -48,7 +48,7 @@ abstract final class UnmodifiableUint8ClampedListView implements Uint8ClampedLis /// /// It is a compile-time error for a class to attempt to extend or implement /// UnmodifiableUint16ListView. -abstract final class UnmodifiableUint16ListView implements Uint16List { +abstract class UnmodifiableUint16ListView implements Uint16List { external factory UnmodifiableUint16ListView(Uint16List list); } @@ -56,7 +56,7 @@ abstract final class UnmodifiableUint16ListView implements Uint16List { /// /// It is a compile-time error for a class to attempt to extend or implement /// UnmodifiableInt16ListView. -abstract final class UnmodifiableInt16ListView implements Int16List { +abstract class UnmodifiableInt16ListView implements Int16List { external factory UnmodifiableInt16ListView(Int16List list); } @@ -64,7 +64,7 @@ abstract final class UnmodifiableInt16ListView implements Int16List { /// /// It is a compile-time error for a class to attempt to extend or implement /// UnmodifiableUint32ListView. -abstract final class UnmodifiableUint32ListView implements Uint32List { +abstract class UnmodifiableUint32ListView implements Uint32List { external factory UnmodifiableUint32ListView(Uint32List list); } @@ -72,7 +72,7 @@ abstract final class UnmodifiableUint32ListView implements Uint32List { /// /// It is a compile-time error for a class to attempt to extend or implement /// UnmodifiableInt32ListView. -abstract final class UnmodifiableInt32ListView implements Int32List { +abstract class UnmodifiableInt32ListView implements Int32List { external factory UnmodifiableInt32ListView(Int32List list); } @@ -80,7 +80,7 @@ abstract final class UnmodifiableInt32ListView implements Int32List { /// /// It is a compile-time error for a class to attempt to extend or implement /// UnmodifiableUint64ListView. -abstract final class UnmodifiableUint64ListView implements Uint64List { +abstract class UnmodifiableUint64ListView implements Uint64List { external factory UnmodifiableUint64ListView(Uint64List list); } @@ -88,7 +88,7 @@ abstract final class UnmodifiableUint64ListView implements Uint64List { /// /// It is a compile-time error for a class to attempt to extend or implement /// UnmodifiableInt64ListView. -abstract final class UnmodifiableInt64ListView implements Int64List { +abstract class UnmodifiableInt64ListView implements Int64List { external factory UnmodifiableInt64ListView(Int64List list); } @@ -96,7 +96,7 @@ abstract final class UnmodifiableInt64ListView implements Int64List { /// /// It is a compile-time error for a class to attempt to extend or implement /// UnmodifiableInt32x4ListView. -abstract final class UnmodifiableInt32x4ListView implements Int32x4List { +abstract class UnmodifiableInt32x4ListView implements Int32x4List { external factory UnmodifiableInt32x4ListView(Int32x4List list); } @@ -104,7 +104,7 @@ abstract final class UnmodifiableInt32x4ListView implements Int32x4List { /// /// It is a compile-time error for a class to attempt to extend or implement /// UnmodifiableFloat32x4ListView. -abstract final class UnmodifiableFloat32x4ListView implements Float32x4List { +abstract class UnmodifiableFloat32x4ListView implements Float32x4List { external factory UnmodifiableFloat32x4ListView(Float32x4List list); } @@ -112,7 +112,7 @@ abstract final class UnmodifiableFloat32x4ListView implements Float32x4List { /// /// It is a compile-time error for a class to attempt to extend or implement /// UnmodifiableFloat64x2ListView. -abstract final class UnmodifiableFloat64x2ListView implements Float64x2List { +abstract class UnmodifiableFloat64x2ListView implements Float64x2List { external factory UnmodifiableFloat64x2ListView(Float64x2List list); } @@ -120,7 +120,7 @@ abstract final class UnmodifiableFloat64x2ListView implements Float64x2List { /// /// It is a compile-time error for a class to attempt to extend or implement /// UnmodifiableFloat32ListView. -abstract final class UnmodifiableFloat32ListView implements Float32List { +abstract class UnmodifiableFloat32ListView implements Float32List { external factory UnmodifiableFloat32ListView(Float32List list); } @@ -128,6 +128,6 @@ abstract final class UnmodifiableFloat32ListView implements Float32List { /// /// It is a compile-time error for a class to attempt to extend or implement /// UnmodifiableFloat64ListView. -abstract final class UnmodifiableFloat64ListView implements Float64List { +abstract class UnmodifiableFloat64ListView implements Float64List { external factory UnmodifiableFloat64ListView(Float64List list); } diff --git a/tests/language/nonfunction_type_aliases/generic_usage_function_error_test.dart b/tests/language/nonfunction_type_aliases/generic_usage_function_error_test.dart index 1895e0136ad..2d809b763d5 100644 --- a/tests/language/nonfunction_type_aliases/generic_usage_function_error_test.dart +++ b/tests/language/nonfunction_type_aliases/generic_usage_function_error_test.dart @@ -2,6 +2,7 @@ // 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. + import 'dart:async'; // Introduce an aliased type. @@ -13,32 +14,12 @@ typedef T = Function; abstract class C { final T v7; - C() : v7 = T(); + C(): v7 = T(); // ^ // [analyzer] unspecified // [cfe] unspecified } -class D1 extends T {} -// ^^^^ -// [analyzer] unspecified -// [cfe] unspecified - -abstract class D2 extends C with T {} -// ^^^^^^ -// [analyzer] unspecified -// [cfe] unspecified - -abstract class D3 implements T {} -// ^^^^ -// [analyzer] unspecified -// [cfe] unspecified - -abstract class D4 = C with T; -// ^^^^^^^ -// [analyzer] unspecified -// [cfe] unspecified - X foo(X x) => x; main() { diff --git a/tests/language/nonfunction_type_aliases/generic_usage_function_test.dart b/tests/language/nonfunction_type_aliases/generic_usage_function_test.dart index edcd18588f3..69b29261712 100644 --- a/tests/language/nonfunction_type_aliases/generic_usage_function_test.dart +++ b/tests/language/nonfunction_type_aliases/generic_usage_function_test.dart @@ -2,6 +2,7 @@ // 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. + import 'dart:async'; // Introduce an aliased type. @@ -26,7 +27,7 @@ abstract class C { List> v6 = []; final T v7; - C() : v7 = print; + C(): v7 = print; C.name1(this.v5, this.v7); factory C.name2(T arg1, T arg2) = C1.name1; @@ -42,6 +43,11 @@ class C1 implements C { noSuchMethod(Invocation invocation) => throw 0; } +class D1 extends T {} +abstract class D2 extends C with T {} +abstract class D3 implements T {} +abstract class D4 = C with T; + extension E on T { T foo(T t) => t; } diff --git a/tests/language/nonfunction_type_aliases/mixed/generic_usage_function_error_test.dart b/tests/language/nonfunction_type_aliases/mixed/generic_usage_function_error_test.dart index 2fc97989640..282e5e63105 100644 --- a/tests/language/nonfunction_type_aliases/mixed/generic_usage_function_error_test.dart +++ b/tests/language/nonfunction_type_aliases/mixed/generic_usage_function_error_test.dart @@ -22,17 +22,6 @@ abstract class C { // [cfe] unspecified } -abstract class D2 extends C with T {} -// ^ -// [analyzer] unspecified -// [cfe] unspecified - -abstract class D4 = C with T; -// ^ -// [analyzer] unspecified -// [cfe] unspecified - - X foo(X x) => x; main() { diff --git a/tests/language/nonfunction_type_aliases/mixed/generic_usage_function_test.dart b/tests/language/nonfunction_type_aliases/mixed/generic_usage_function_test.dart index b31e41b7e2a..4aecb7d9c58 100644 --- a/tests/language/nonfunction_type_aliases/mixed/generic_usage_function_test.dart +++ b/tests/language/nonfunction_type_aliases/mixed/generic_usage_function_test.dart @@ -4,6 +4,7 @@ // @dart = 2.9 // Requirements=nnbd-weak + // Test that a generic type alias `T` denoting `Function` // can give rise to the expected erros. @@ -46,8 +47,12 @@ class C1 implements C { class D1 extends T {} +abstract class D2 extends C with T {} + abstract class D3 implements T {} +abstract class D4 = C with T; + extension E on T { T foo(T t) => t; } diff --git a/tests/language/nonfunction_type_aliases/mixed/usage_function_test.dart b/tests/language/nonfunction_type_aliases/mixed/usage_function_test.dart index de66f1b0130..3827ee18d73 100644 --- a/tests/language/nonfunction_type_aliases/mixed/usage_function_test.dart +++ b/tests/language/nonfunction_type_aliases/mixed/usage_function_test.dart @@ -4,6 +4,7 @@ // @dart = 2.9 // Requirements=nnbd-weak + // Test that a type alias `T` denoting `Function` can be used. import 'usage_function_lib.dart'; @@ -44,8 +45,12 @@ class C1 implements C { class D1 extends T {} +abstract class D2 extends C with T {} + abstract class D3 implements T {} +abstract class D4 = C with T; + extension E on T { T foo(T t) => t; } diff --git a/tests/language/nonfunction_type_aliases/usage_function_error_test.dart b/tests/language/nonfunction_type_aliases/usage_function_error_test.dart index b0eb1a450be..dd73fe7f1f6 100644 --- a/tests/language/nonfunction_type_aliases/usage_function_error_test.dart +++ b/tests/language/nonfunction_type_aliases/usage_function_error_test.dart @@ -2,6 +2,7 @@ // 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. + // Introduce an aliased type. typedef T = Function; @@ -11,32 +12,12 @@ typedef T = Function; abstract class C { final T v12; - C() : v12 = T(); + C(): v12 = T(); // ^ // [analyzer] unspecified // [cfe] unspecified } -class D1 extends T {} -// ^ -// [analyzer] unspecified -// [cfe] unspecified - -abstract class D2 extends C with T {} -// ^ -// [analyzer] unspecified -// [cfe] unspecified - -abstract class D3 implements T {} -// ^ -// [analyzer] unspecified -// [cfe] unspecified - -abstract class D4 = C with T; -// ^ -// [analyzer] unspecified -// [cfe] unspecified - X foo(X x) => x; main() { diff --git a/tests/language/nonfunction_type_aliases/usage_function_test.dart b/tests/language/nonfunction_type_aliases/usage_function_test.dart index bb8428f5284..fc49e1337ab 100644 --- a/tests/language/nonfunction_type_aliases/usage_function_test.dart +++ b/tests/language/nonfunction_type_aliases/usage_function_test.dart @@ -2,6 +2,7 @@ // 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. + // Introduce an aliased type. typedef T = Function; @@ -24,7 +25,7 @@ abstract class C { List v11 = []; final T v12; - C() : v12 = (() {}); + C(): v12 = (() {}); C.name1(this.v10, this.v12); factory C.name2(T arg1, T arg2) = C1.name1; @@ -40,6 +41,14 @@ class C1 implements C { noSuchMethod(Invocation invocation) => throw 0; } +// Awaiting updates in front end to handle crash caused by null from +// `ClassHierarchyBuilder.getKernelTypeAsInstanceOf`. So for now the +// following are multi-test cases, so that the rest can be tested. +class D1 extends T {} //# 01: ok +abstract class D2 extends C with T {} //# 02: ok +abstract class D3 implements T {} //# 03: ok +abstract class D4 = C with T; //# 04: ok + extension E on T { T foo(T t) => t; } diff --git a/tools/dom/scripts/css_code_generator.py b/tools/dom/scripts/css_code_generator.py index 78fc833fadb..3726fe5c3ca 100644 --- a/tools/dom/scripts/css_code_generator.py +++ b/tools/dom/scripts/css_code_generator.py @@ -277,7 +277,7 @@ class _CssStyleDeclarationSet extends Object with CssStyleDeclarationBase { // items in the MEMBERS set if you want that functionality. } -abstract mixin class CssStyleDeclarationBase { +abstract class CssStyleDeclarationBase { String getPropertyValue(String propertyName); void setProperty(String propertyName, String$NULLABLE value, [String$NULLABLE priority]); diff --git a/tools/dom/src/ImmutableListMixin.dart b/tools/dom/src/ImmutableListMixin.dart index 50a08ccf0d8..9910ebee48e 100644 --- a/tools/dom/src/ImmutableListMixin.dart +++ b/tools/dom/src/ImmutableListMixin.dart @@ -4,7 +4,7 @@ part of dart.dom.html; -abstract mixin class ImmutableListMixin implements List { +abstract class ImmutableListMixin implements List { // From Iterable<$E>: Iterator get iterator { // Note: NodeLists are not fixed size. And most probably length shouldn't diff --git a/tools/dom/templates/html/impl/impl_CSSStyleDeclaration.darttemplate b/tools/dom/templates/html/impl/impl_CSSStyleDeclaration.darttemplate index 8ac46816a5a..1c1266c9a18 100644 --- a/tools/dom/templates/html/impl/impl_CSSStyleDeclaration.darttemplate +++ b/tools/dom/templates/html/impl/impl_CSSStyleDeclaration.darttemplate @@ -1855,7 +1855,7 @@ class _CssStyleDeclarationSet extends Object with CssStyleDeclarationBase { // items in the MEMBERS set if you want that functionality. } -abstract mixin class CssStyleDeclarationBase { +abstract class CssStyleDeclarationBase { String getPropertyValue(String propertyName); void setProperty(String propertyName, String$NULLABLE value, [String$NULLABLE priority]); diff --git a/tools/experimental_features.yaml b/tools/experimental_features.yaml index 6903371886d..089e2b1679a 100644 --- a/tools/experimental_features.yaml +++ b/tools/experimental_features.yaml @@ -142,11 +142,9 @@ features: sealed-class: help: "Sealed class" - experimentalReleaseVersion: "3.0.0" class-modifiers: help: "Class modifiers" - experimentalReleaseVersion: "3.0.0" # Experiment flag only used for testing. test-experiment: