From 460075336b52d37176de9e052b583ee240abc0d1 Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Mon, 29 Aug 2022 22:56:27 +0000 Subject: [PATCH] pkg:compiler - enable and fix use_super_parameters lint Change-Id: I2d8ae1db222fc70729fda9eeb62296285de9da33 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256760 Auto-Submit: Kevin Moore Commit-Queue: Mayank Patke Commit-Queue: Kevin Moore Reviewed-by: Mayank Patke --- pkg/compiler/analysis_options.yaml | 1 + pkg/compiler/lib/src/common/elements.dart | 6 +- pkg/compiler/lib/src/constants/values.dart | 15 ++--- .../lib/src/deferred_load/entity_data.dart | 10 +-- .../program_split_constraints/nodes.dart | 4 +- pkg/compiler/lib/src/elements/names.dart | 3 +- .../lib/src/inferrer/type_graph_nodes.dart | 42 ++++++------ pkg/compiler/lib/src/io/code_output.dart | 2 +- .../lib/src/io/source_information.dart | 3 +- pkg/compiler/lib/src/ir/closure.dart | 27 +++----- pkg/compiler/lib/src/ir/static_type.dart | 3 +- pkg/compiler/lib/src/ir/static_type_base.dart | 8 +-- .../js_backend/custom_elements_analysis.dart | 9 ++- pkg/compiler/lib/src/js_emitter/model.dart | 64 +++++++------------ .../lib/src/js_model/closure_migrated.dart | 12 ++-- pkg/compiler/lib/src/js_model/elements.dart | 40 +++++------- pkg/compiler/lib/src/kernel/kelements.dart | 40 +++++------- pkg/compiler/lib/src/native/enqueue.dart | 20 ++---- .../lib/src/universe/member_usage.dart | 20 +++--- pkg/compiler/pubspec.yaml | 2 +- 20 files changed, 135 insertions(+), 196 deletions(-) diff --git a/pkg/compiler/analysis_options.yaml b/pkg/compiler/analysis_options.yaml index 16459419a28..c2ef0bcd3d3 100644 --- a/pkg/compiler/analysis_options.yaml +++ b/pkg/compiler/analysis_options.yaml @@ -14,3 +14,4 @@ linter: - prefer_final_fields - prefer_if_null_operators - prefer_null_aware_operators + - use_super_parameters diff --git a/pkg/compiler/lib/src/common/elements.dart b/pkg/compiler/lib/src/common/elements.dart index 9fc40de2d1e..83a960c9983 100644 --- a/pkg/compiler/lib/src/common/elements.dart +++ b/pkg/compiler/lib/src/common/elements.dart @@ -1022,8 +1022,7 @@ abstract class CommonElements { } class KCommonElements extends CommonElements { - KCommonElements(DartTypes dartTypes, ElementEnvironment env) - : super(dartTypes, env); + KCommonElements(super.dartTypes, super.env); // From package:js @@ -1067,8 +1066,7 @@ class KCommonElements extends CommonElements { class JCommonElements extends CommonElements { FunctionEntity? _jsStringSplit; - JCommonElements(DartTypes dartTypes, ElementEnvironment env) - : super(dartTypes, env); + JCommonElements(super.dartTypes, super.env); /// Returns `true` if [element] is the unnamed constructor of `List`. /// diff --git a/pkg/compiler/lib/src/constants/values.dart b/pkg/compiler/lib/src/constants/values.dart index 658aad00349..1bbef1207ed 100644 --- a/pkg/compiler/lib/src/constants/values.dart +++ b/pkg/compiler/lib/src/constants/values.dart @@ -515,10 +515,9 @@ class ListConstantValue extends ObjectConstantValue { @override final int hashCode; - ListConstantValue(InterfaceType type, List entries) + ListConstantValue(super.type, List entries) : this.entries = entries, - hashCode = Hashing.listHash(entries, Hashing.objectHash(type)), - super(type); + hashCode = Hashing.listHash(entries, Hashing.objectHash(type)); @override bool operator ==(var other) { @@ -578,10 +577,9 @@ abstract class SetConstantValue extends ObjectConstantValue { @override final int hashCode; - SetConstantValue(InterfaceType type, List values) + SetConstantValue(super.type, List values) : values = values, - hashCode = Hashing.listHash(values, Hashing.objectHash(type)), - super(type); + hashCode = Hashing.listHash(values, Hashing.objectHash(type)); @override bool operator ==(var other) { @@ -642,12 +640,11 @@ abstract class MapConstantValue extends ObjectConstantValue { Map? _lookupMap; MapConstantValue( - InterfaceType type, List keys, List values) + super.type, List keys, List values) : this.keys = keys, this.values = values, this.hashCode = Hashing.listHash( - values, Hashing.listHash(keys, Hashing.objectHash(type))), - super(type) { + values, Hashing.listHash(keys, Hashing.objectHash(type))) { assert(keys.length == values.length); } diff --git a/pkg/compiler/lib/src/deferred_load/entity_data.dart b/pkg/compiler/lib/src/deferred_load/entity_data.dart index bfb81f2c396..f63b192f094 100644 --- a/pkg/compiler/lib/src/deferred_load/entity_data.dart +++ b/pkg/compiler/lib/src/deferred_load/entity_data.dart @@ -26,7 +26,7 @@ class ClassEntityData extends EntityData { visitor.visitClassEntityData(entity); } - ClassEntityData(ClassEntity entity) : super(entity); + ClassEntityData(super.entity); } class ClassTypeEntityData extends EntityData { @@ -35,7 +35,7 @@ class ClassTypeEntityData extends EntityData { visitor.visitClassTypeEntityData(entity); } - ClassTypeEntityData(ClassEntity entity) : super(entity); + ClassTypeEntityData(super.entity); } class MemberEntityData extends EntityData { @@ -44,7 +44,7 @@ class MemberEntityData extends EntityData { visitor.visitMemberEntityData(entity); } - MemberEntityData(MemberEntity entity) : super(entity); + MemberEntityData(super.entity); } class LocalFunctionEntityData extends EntityData { @@ -56,7 +56,7 @@ class LocalFunctionEntityData extends EntityData { @override bool get needsRecursiveUpdate => false; - LocalFunctionEntityData(Local entity) : super(entity); + LocalFunctionEntityData(super.entity); } class ConstantEntityData extends EntityData { @@ -65,7 +65,7 @@ class ConstantEntityData extends EntityData { visitor.visitConstantEntityData(entity); } - ConstantEntityData(ConstantValue entity) : super(entity); + ConstantEntityData(super.entity); } /// A registry used to canonicalize [EntityData]. diff --git a/pkg/compiler/lib/src/deferred_load/program_split_constraints/nodes.dart b/pkg/compiler/lib/src/deferred_load/program_split_constraints/nodes.dart index 50abe034828..9970565bbbb 100644 --- a/pkg/compiler/lib/src/deferred_load/program_split_constraints/nodes.dart +++ b/pkg/compiler/lib/src/deferred_load/program_split_constraints/nodes.dart @@ -44,7 +44,7 @@ class ReferenceNode extends NamedNode { Uri get uri => _uriAndPrefix.uri; String get prefix => _uriAndPrefix.prefix; - ReferenceNode(String name, this._uriAndPrefix) : super(name); + ReferenceNode(super.name, this._uriAndPrefix); @override Map toJson() { @@ -117,7 +117,7 @@ class CombinerNode extends NamedNode { final CombinerType type; final Set nodes; - CombinerNode(String name, this.type, this.nodes) : super(name); + CombinerNode(super.name, this.type, this.nodes); @override Map toJson() { diff --git a/pkg/compiler/lib/src/elements/names.dart b/pkg/compiler/lib/src/elements/names.dart index 5a29f209b9f..13fe1fe4afd 100644 --- a/pkg/compiler/lib/src/elements/names.dart +++ b/pkg/compiler/lib/src/elements/names.dart @@ -115,8 +115,7 @@ class PrivateName extends PublicName { @override final Uri uri; - PrivateName(String text, this.uri, {bool isSetter = false}) - : super(text, isSetter: isSetter); + PrivateName(super.text, this.uri, {super.isSetter}); @override Name get getter => isSetter ? PrivateName(text, uri) : this; diff --git a/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart b/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart index 5dc9a94690b..ffeeb7e1188 100644 --- a/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart +++ b/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart @@ -17,8 +17,8 @@ import '../util/util.dart' show Setlet; import '../world_interfaces.dart' show JClosedWorld; import 'abstract_value_domain.dart'; import 'debug.dart' as debug; -import 'locals_handler.dart' show ArgumentsTypes; import 'engine_interfaces.dart'; +import 'locals_handler.dart' show ArgumentsTypes; import 'type_system.dart'; /// Common class for all nodes in the graph. The current nodes are: @@ -753,23 +753,27 @@ class ParameterTypeInformation extends ElementTypeInformation { bool _isTearOffClosureParameter = false; ParameterTypeInformation.localFunction( - AbstractValueDomain abstractValueDomain, - MemberTypeInformation context, + super.abstractValueDomain, + MemberTypeInformation super.context, this._parameter, this._type, this._method) : _isInstanceMemberParameter = false, _isClosureParameter = true, _isInitializingFormal = false, - super._internal(abstractValueDomain, context); + super._internal(); - ParameterTypeInformation.static(AbstractValueDomain abstractValueDomain, - MemberTypeInformation context, this._parameter, this._type, this._method, + ParameterTypeInformation.static( + super.abstractValueDomain, + MemberTypeInformation super.context, + this._parameter, + this._type, + this._method, {bool isInitializingFormal = false}) : _isInstanceMemberParameter = false, _isClosureParameter = false, _isInitializingFormal = isInitializingFormal, - super._internal(abstractValueDomain, context); + super._internal(); ParameterTypeInformation.instanceMember( AbstractValueDomain abstractValueDomain, @@ -1483,7 +1487,7 @@ class ClosureCallSiteTypeInformation extends CallSiteTypeInformation { /// because we know such node will never be refined to a different /// type. class ConcreteTypeInformation extends TypeInformation { - ConcreteTypeInformation(AbstractValue type) : super.untracked(type) { + ConcreteTypeInformation(super.type) : super.untracked() { this.isStable = true; } @@ -1717,9 +1721,8 @@ class ListTypeInformation extends TypeInformation with TracedTypeInformation { /// An [ElementInContainerTypeInformation] holds the common type of the /// elements in a [ListTypeInformation]. class ElementInContainerTypeInformation extends InferredTypeInformation { - ElementInContainerTypeInformation(AbstractValueDomain abstractValueDomain, - MemberTypeInformation? context, elementType) - : super(abstractValueDomain, context, elementType); + ElementInContainerTypeInformation( + super.abstractValueDomain, super.context, super.elementType); @override String toString() => 'Element in container $type'; @@ -1784,9 +1787,8 @@ class SetTypeInformation extends TypeInformation with TracedTypeInformation { /// An [ElementInSetTypeInformation] holds the common type of the elements in a /// [SetTypeInformation]. class ElementInSetTypeInformation extends InferredTypeInformation { - ElementInSetTypeInformation(AbstractValueDomain abstractValueDomain, - MemberTypeInformation? context, elementType) - : super(abstractValueDomain, context, elementType); + ElementInSetTypeInformation( + super.abstractValueDomain, super.context, super.elementType); @override String toString() => 'Element in set $type'; @@ -1966,9 +1968,8 @@ class MapTypeInformation extends TypeInformation with TracedTypeInformation { /// A [KeyInMapTypeInformation] holds the common type /// for the keys in a [MapTypeInformation] class KeyInMapTypeInformation extends InferredTypeInformation { - KeyInMapTypeInformation(AbstractValueDomain abstractValueDomain, - MemberTypeInformation? context, TypeInformation keyType) - : super(abstractValueDomain, context, keyType); + KeyInMapTypeInformation( + super.abstractValueDomain, super.context, TypeInformation super.keyType); @override accept(TypeInformationVisitor visitor) { @@ -1987,10 +1988,9 @@ class ValueInMapTypeInformation extends InferredTypeInformation { // mode can ever be marked as [nonNull]. final bool nonNull; - ValueInMapTypeInformation(AbstractValueDomain abstractValueDomain, - MemberTypeInformation? context, TypeInformation? valueType, - [this.nonNull = false]) - : super(abstractValueDomain, context, valueType); + ValueInMapTypeInformation( + super.abstractValueDomain, super.context, super.valueType, + [this.nonNull = false]); @override accept(TypeInformationVisitor visitor) { diff --git a/pkg/compiler/lib/src/io/code_output.dart b/pkg/compiler/lib/src/io/code_output.dart index 58812cda064..7dc22c0af4b 100644 --- a/pkg/compiler/lib/src/io/code_output.dart +++ b/pkg/compiler/lib/src/io/code_output.dart @@ -196,7 +196,7 @@ abstract class BufferedCodeOutput { class CodeBuffer extends AbstractCodeOutput implements BufferedCodeOutput { StringBuffer buffer = StringBuffer(); - CodeBuffer([List? listeners]) : super(listeners); + CodeBuffer([super.listeners]); @override void _addInternal(String text) { diff --git a/pkg/compiler/lib/src/io/source_information.dart b/pkg/compiler/lib/src/io/source_information.dart index a07177ac68c..62bae4e2010 100644 --- a/pkg/compiler/lib/src/io/source_information.dart +++ b/pkg/compiler/lib/src/io/source_information.dart @@ -399,8 +399,7 @@ class OffsetSourceLocation extends AbstractSourceLocation { @override final String sourceName; - OffsetSourceLocation(SourceFile sourceFile, this.offset, this.sourceName) - : super(sourceFile); + OffsetSourceLocation(super.sourceFile, this.offset, this.sourceName); @override String get shortText => '${super.shortText}:$sourceName'; diff --git a/pkg/compiler/lib/src/ir/closure.dart b/pkg/compiler/lib/src/ir/closure.dart index d409cb6dbad..ac239734cb5 100644 --- a/pkg/compiler/lib/src/ir/closure.dart +++ b/pkg/compiler/lib/src/ir/closure.dart @@ -98,24 +98,15 @@ class KernelScopeInfo { class KernelCapturedScope extends KernelScopeInfo { KernelCapturedScope( - Set boxedVariables, - NodeBox? capturedVariablesAccessor, - Set localsUsedInTryOrSync, - Set - freeVariables, - Map> freeVariablesForRti, - bool thisUsedAsFreeVariable, - Set thisUsedAsFreeVariableIfNeedsRti, - bool hasThisLocal) - : super.withBoxedVariables( - boxedVariables, - capturedVariablesAccessor, - localsUsedInTryOrSync, - freeVariables, - freeVariablesForRti, - thisUsedAsFreeVariable, - thisUsedAsFreeVariableIfNeedsRti, - hasThisLocal); + super.boxedVariables, + super.capturedVariablesAccessor, + super.localsUsedInTryOrSync, + super.freeVariables, + super.freeVariablesForRti, + super.thisUsedAsFreeVariable, + super.thisUsedAsFreeVariableIfNeedsRti, + super.hasThisLocal) + : super.withBoxedVariables(); // Loops through the free variables of an existing KernelCapturedScope and // creates a new KernelCapturedScope that only captures type variables. diff --git a/pkg/compiler/lib/src/ir/static_type.dart b/pkg/compiler/lib/src/ir/static_type.dart index 0ae7ee18e5b..fc95444cace 100644 --- a/pkg/compiler/lib/src/ir/static_type.dart +++ b/pkg/compiler/lib/src/ir/static_type.dart @@ -69,8 +69,7 @@ abstract class StaticTypeVisitor extends StaticTypeBase { ir.Library? _currentLibrary; StaticTypeVisitor( - ir.TypeEnvironment typeEnvironment, this.hierarchy, this._staticTypeCache) - : super(typeEnvironment); + super.typeEnvironment, this.hierarchy, this._staticTypeCache); StaticTypeCache getStaticTypeCache() { return StaticTypeCache(_staticTypeCache._expressionTypes, diff --git a/pkg/compiler/lib/src/ir/static_type_base.dart b/pkg/compiler/lib/src/ir/static_type_base.dart index d71ba62b167..030c801d921 100644 --- a/pkg/compiler/lib/src/ir/static_type_base.dart +++ b/pkg/compiler/lib/src/ir/static_type_base.dart @@ -18,9 +18,7 @@ class DoesNotCompleteType extends ir.NeverType { /// Special interface type used to signal that the static type of an expression /// has precision of a this-expression. class ThisInterfaceType extends ir.InterfaceType { - ThisInterfaceType(ir.Class classNode, ir.Nullability nullability, - [List? typeArguments]) - : super(classNode, nullability, typeArguments); + ThisInterfaceType(super.classNode, super.nullability, [super.typeArguments]); static from(ir.InterfaceType? type) => type != null ? ThisInterfaceType(type.classNode, type.nullability, type.typeArguments) @@ -41,9 +39,7 @@ class ThisInterfaceType extends ir.InterfaceType { /// Special interface type used to signal that the static type of an expression /// is exact, i.e. the runtime type is not a subtype or subclass of the type. class ExactInterfaceType extends ir.InterfaceType { - ExactInterfaceType(ir.Class classNode, ir.Nullability nullability, - [List? typeArguments]) - : super(classNode, nullability, typeArguments); + ExactInterfaceType(super.classNode, super.nullability, [super.typeArguments]); static from(ir.InterfaceType? type) => type != null ? ExactInterfaceType(type.classNode, type.nullability, type.typeArguments) diff --git a/pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart b/pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart index a5a160622cc..4102ce1a8c5 100644 --- a/pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart +++ b/pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart @@ -84,14 +84,13 @@ class CustomElementsResolutionAnalysis extends CustomElementsAnalysisBase { final CustomElementsAnalysisJoin join; CustomElementsResolutionAnalysis( - ElementEnvironment elementEnvironment, - CommonElements commonElements, - NativeBasicData nativeData, + super.elementEnvironment, + super.commonElements, + super.nativeData, BackendUsageBuilder backendUsageBuilder) : join = CustomElementsAnalysisJoin( elementEnvironment, commonElements, nativeData, - backendUsageBuilder: backendUsageBuilder), - super(elementEnvironment, commonElements, nativeData) { + backendUsageBuilder: backendUsageBuilder) { // TODO(sra): Remove this work-around. We should mark allClassesSelected in // both joins only when we see a construct generating an unknown [Type] but // we can't currently recognize all cases. In particular, the work-around diff --git a/pkg/compiler/lib/src/js_emitter/model.dart b/pkg/compiler/lib/src/js_emitter/model.dart index fd161831117..fcbdb2f4743 100644 --- a/pkg/compiler/lib/src/js_emitter/model.dart +++ b/pkg/compiler/lib/src/js_emitter/model.dart @@ -439,7 +439,7 @@ abstract class DartMethod extends Method { // `call$1$name` (in unminified mode). final js.Name? callName; - DartMethod(FunctionEntity element, js.Name name, js.Expression code, + DartMethod(FunctionEntity super.element, super.name, super.code, this.parameterStubs, this.callName, {required this.needsTearOff, this.tearOffName, @@ -447,8 +447,7 @@ abstract class DartMethod extends Method { required this.requiredParameterCount, this.optionalParameterDefaultValues, this.functionType, - required this.applyIndex}) - : super(element, name, code) { + required this.applyIndex}) { assert(!needsTearOff || tearOffName != null); assert(!canBeApplied || optionalParameterDefaultValues != null); } @@ -485,31 +484,24 @@ class InstanceMethod extends DartMethod { ///final js.Name applyName; InstanceMethod( - FunctionEntity element, - js.Name name, - js.Expression code, - List parameterStubs, - js.Name callName, { - required bool needsTearOff, - js.Name? tearOffName, + super.element, + super.name, + super.code, + super.parameterStubs, + js.Name super.callName, { + required super.needsTearOff, + super.tearOffName, this.aliasName, required this.tearOffNeedsDirectAccess, - required bool canBeApplied, - required int requiredParameterCount, - /* List | Map */ optionalParameterDefaultValues, + required super.canBeApplied, + required super.requiredParameterCount, + /* List | Map */ super.optionalParameterDefaultValues, required this.isClosureCallMethod, required this.inheritsApplyMetadata, required this.isIntercepted, - js.Expression? functionType, - required int applyIndex, - }) : super(element, name, code, parameterStubs, callName, - needsTearOff: needsTearOff, - tearOffName: tearOffName, - canBeApplied: canBeApplied, - requiredParameterCount: requiredParameterCount, - optionalParameterDefaultValues: optionalParameterDefaultValues, - functionType: functionType, - applyIndex: applyIndex); + super.functionType, + required super.applyIndex, + }); @override bool get isStatic => false; @@ -567,23 +559,15 @@ class ParameterStubMethod extends StubMethod { abstract class StaticMethod implements Method {} class StaticDartMethod extends DartMethod implements StaticMethod { - StaticDartMethod(FunctionEntity element, js.Name name, js.Expression code, - List parameterStubs, js.Name callName, - {required bool needsTearOff, - js.Name? tearOffName, - required bool canBeApplied, - required int requiredParameterCount, - /* List | Map */ optionalParameterDefaultValues, - js.Expression? functionType, - required int applyIndex}) - : super(element, name, code, parameterStubs, callName, - needsTearOff: needsTearOff, - tearOffName: tearOffName, - canBeApplied: canBeApplied, - requiredParameterCount: requiredParameterCount, - optionalParameterDefaultValues: optionalParameterDefaultValues, - functionType: functionType, - applyIndex: applyIndex); + StaticDartMethod(super.element, super.name, super.code, super.parameterStubs, + js.Name super.callName, + {required super.needsTearOff, + super.tearOffName, + required super.canBeApplied, + required super.requiredParameterCount, + /* List | Map */ super.optionalParameterDefaultValues, + super.functionType, + required super.applyIndex}); @override bool get isStatic => true; diff --git a/pkg/compiler/lib/src/js_model/closure_migrated.dart b/pkg/compiler/lib/src/js_model/closure_migrated.dart index 921fa2f7697..ddfdee829e3 100644 --- a/pkg/compiler/lib/src/js_model/closure_migrated.dart +++ b/pkg/compiler/lib/src/js_model/closure_migrated.dart @@ -99,8 +99,7 @@ class JClosureClass extends JClass { /// debugging data stream. static const String tag = 'closure-class'; - JClosureClass(JLibrary library, String name) - : super(library, name, isAbstract: false); + JClosureClass(super.library, super.name) : super(isAbstract: false); factory JClosureClass.readFromDataSource(DataSourceReader source) { source.begin(tag); @@ -168,11 +167,10 @@ class JClosureField extends JField implements PrivatelyNamedJSEntity { isAssignable: isAssignable, isConst: isConst); - JClosureField.internal(JLibrary library, JClosureClass enclosingClass, - Name memberName, this.declaredName, - {required bool isConst, required bool isAssignable}) - : super(library, enclosingClass, memberName, - isAssignable: isAssignable, isConst: isConst, isStatic: false); + JClosureField.internal(super.library, JClosureClass super.enclosingClass, + super.memberName, this.declaredName, + {required super.isConst, required super.isAssignable}) + : super(isStatic: false); factory JClosureField.readFromDataSource(DataSourceReader source) { source.begin(tag); diff --git a/pkg/compiler/lib/src/js_model/elements.dart b/pkg/compiler/lib/src/js_model/elements.dart index fdb122c9b02..44ec9590900 100644 --- a/pkg/compiler/lib/src/js_model/elements.dart +++ b/pkg/compiler/lib/src/js_model/elements.dart @@ -222,10 +222,9 @@ abstract class JFunction extends JMember @override final AsyncMarker asyncMarker; - JFunction(JLibrary library, JClass? enclosingClass, Name name, + JFunction(super.library, super.enclosingClass, super.name, this.parameterStructure, this.asyncMarker, - {bool isStatic = false, this.isExternal = false}) - : super(library, enclosingClass, name, isStatic: isStatic); + {super.isStatic, this.isExternal = false}); } abstract class JConstructor extends JFunction @@ -267,10 +266,8 @@ class JGenerativeConstructor extends JConstructor { static const String tag = 'generative-constructor'; JGenerativeConstructor( - JClass enclosingClass, Name name, ParameterStructure parameterStructure, - {required bool isExternal, required bool isConst}) - : super(enclosingClass, name, parameterStructure, - isExternal: isExternal, isConst: isConst); + super.enclosingClass, super.name, super.parameterStructure, + {required super.isExternal, required super.isConst}); factory JGenerativeConstructor.readFromDataSource(DataSourceReader source) { source.begin(tag); @@ -314,12 +311,10 @@ class JFactoryConstructor extends JConstructor { final bool isFromEnvironmentConstructor; JFactoryConstructor( - JClass enclosingClass, Name name, ParameterStructure parameterStructure, - {required bool isExternal, - required bool isConst, - required this.isFromEnvironmentConstructor}) - : super(enclosingClass, name, parameterStructure, - isExternal: isExternal, isConst: isConst); + super.enclosingClass, super.name, super.parameterStructure, + {required super.isExternal, + required super.isConst, + required this.isFromEnvironmentConstructor}); factory JFactoryConstructor.readFromDataSource(DataSourceReader source) { source.begin(tag); @@ -401,13 +396,11 @@ class JMethod extends JFunction { @override final bool isAbstract; - JMethod(JLibrary library, JClass? enclosingClass, Name name, - ParameterStructure parameterStructure, AsyncMarker asyncMarker, - {required bool isStatic, - required bool isExternal, - required this.isAbstract}) - : super(library, enclosingClass, name, parameterStructure, asyncMarker, - isStatic: isStatic, isExternal: isExternal); + JMethod(super.library, super.enclosingClass, super.name, + super.parameterStructure, super.asyncMarker, + {required super.isStatic, + required super.isExternal, + required this.isAbstract}); factory JMethod.readFromDataSource(DataSourceReader source) { source.begin(tag); @@ -644,11 +637,10 @@ class JField extends JMember implements FieldEntity, IndexedField { @override final bool isConst; - JField(JLibrary library, JClass? enclosingClass, Name name, - {required bool isStatic, + JField(super.library, super.enclosingClass, super.name, + {required super.isStatic, required this.isAssignable, - required this.isConst}) - : super(library, enclosingClass, name, isStatic: isStatic); + required this.isConst}); factory JField.readFromDataSource(DataSourceReader source) { source.begin(tag); diff --git a/pkg/compiler/lib/src/kernel/kelements.dart b/pkg/compiler/lib/src/kernel/kelements.dart index b2a74094c45..14dbeb7061a 100644 --- a/pkg/compiler/lib/src/kernel/kelements.dart +++ b/pkg/compiler/lib/src/kernel/kelements.dart @@ -111,10 +111,9 @@ abstract class KFunction extends KMember @override final AsyncMarker asyncMarker; - KFunction(KLibrary library, KClass enclosingClass, Name name, + KFunction(super.library, KClass super.enclosingClass, super.name, this.parameterStructure, this.asyncMarker, - {bool isStatic = false, this.isExternal = false}) - : super(library, enclosingClass, name, isStatic: isStatic); + {super.isStatic, this.isExternal = false}); } abstract class KConstructor extends KFunction @@ -152,10 +151,8 @@ abstract class KConstructor extends KFunction class KGenerativeConstructor extends KConstructor { KGenerativeConstructor( - KClass enclosingClass, Name name, ParameterStructure parameterStructure, - {required bool isExternal, required bool isConst}) - : super(enclosingClass, name, parameterStructure, - isExternal: isExternal, isConst: isConst); + super.enclosingClass, super.name, super.parameterStructure, + {required super.isExternal, required super.isConst}); @override bool get isFactoryConstructor => false; @@ -169,12 +166,10 @@ class KFactoryConstructor extends KConstructor { final bool isFromEnvironmentConstructor; KFactoryConstructor( - KClass enclosingClass, Name name, ParameterStructure parameterStructure, - {required bool isExternal, - required bool isConst, - required this.isFromEnvironmentConstructor}) - : super(enclosingClass, name, parameterStructure, - isExternal: isExternal, isConst: isConst); + super.enclosingClass, super.name, super.parameterStructure, + {required super.isExternal, + required super.isConst, + required this.isFromEnvironmentConstructor}); @override bool get isFactoryConstructor => true; @@ -187,13 +182,11 @@ class KMethod extends KFunction { @override final bool isAbstract; - KMethod(KLibrary library, KClass enclosingClass, Name name, - ParameterStructure parameterStructure, AsyncMarker asyncMarker, - {required bool isStatic, - required bool isExternal, - required this.isAbstract}) - : super(library, enclosingClass, name, parameterStructure, asyncMarker, - isStatic: isStatic, isExternal: isExternal); + KMethod(super.library, super.enclosingClass, super.name, + super.parameterStructure, super.asyncMarker, + {required super.isStatic, + required super.isExternal, + required this.isAbstract}); @override bool get isFunction => true; @@ -250,11 +243,10 @@ class KField extends KMember implements FieldEntity, IndexedField { @override final bool isConst; - KField(KLibrary library, KClass enclosingClass, Name name, - {required bool isStatic, + KField(super.library, KClass super.enclosingClass, super.name, + {required super.isStatic, required this.isAssignable, - required this.isConst}) - : super(library, enclosingClass, name, isStatic: isStatic); + required this.isConst}); @override bool get isField => true; diff --git a/pkg/compiler/lib/src/native/enqueue.dart b/pkg/compiler/lib/src/native/enqueue.dart index 7b6f7374a40..0f3f1382fcb 100644 --- a/pkg/compiler/lib/src/native/enqueue.dart +++ b/pkg/compiler/lib/src/native/enqueue.dart @@ -166,13 +166,8 @@ class NativeResolutionEnqueuer extends NativeEnqueuer { /// and exactly one of [unusedClasses] and [registeredClasses]. final Set _nativeClasses = {}; - NativeResolutionEnqueuer( - CompilerOptions options, - ElementEnvironment elementEnvironment, - CommonElements commonElements, - DartTypes dartTypes, - this._nativeClassFinder) - : super(options, elementEnvironment, commonElements, dartTypes); + NativeResolutionEnqueuer(super.options, super.elementEnvironment, + super.commonElements, super.dartTypes, this._nativeClassFinder); Iterable get nativeClassesForTesting => _nativeClasses; @@ -209,14 +204,13 @@ class NativeCodegenEnqueuer extends NativeEnqueuer { final Set _doneAddSubtypes = {}; NativeCodegenEnqueuer( - CompilerOptions options, - ElementEnvironment elementEnvironment, - CommonElements commonElements, - DartTypes dartTypes, + super.options, + super.elementEnvironment, + super.commonElements, + super.dartTypes, this._emitter, this._nativeClasses, - this._nativeData) - : super(options, elementEnvironment, commonElements, dartTypes); + this._nativeData); @override WorldImpact processNativeClasses(Iterable libraries) { diff --git a/pkg/compiler/lib/src/universe/member_usage.dart b/pkg/compiler/lib/src/universe/member_usage.dart index 558f8ac7a3f..d9321e7ef48 100644 --- a/pkg/compiler/lib/src/universe/member_usage.dart +++ b/pkg/compiler/lib/src/universe/member_usage.dart @@ -278,7 +278,7 @@ class PropertyUsage extends MemberUsage { @override final EnumSet invokes; - PropertyUsage.cloned(MemberEntity member, EnumSet pendingUse, + PropertyUsage.cloned(super.member, super.pendingUse, {required this.potentialReads, required this.potentialWrites, required this.potentialInvokes, @@ -292,9 +292,9 @@ class PropertyUsage extends MemberUsage { assert((reads as dynamic) != null), assert((writes as dynamic) != null), assert((invokes as dynamic) != null), - super.cloned(member, pendingUse); + super.cloned(); - PropertyUsage(MemberEntity member, + PropertyUsage(super.member, {required this.potentialReads, required this.potentialWrites, required this.potentialInvokes}) @@ -305,7 +305,7 @@ class PropertyUsage extends MemberUsage { assert((potentialReads as dynamic) != null), assert((potentialWrites as dynamic) != null), assert((potentialInvokes as dynamic) != null), - super.internal(member); + super.internal(); @override EnumSet read(EnumSet accesses) { @@ -390,7 +390,7 @@ class FieldUsage extends MemberUsage { List? _initialConstants; - FieldUsage.cloned(FieldEntity field, EnumSet pendingUse, + FieldUsage.cloned(FieldEntity super.field, super.pendingUse, {required this.potentialReads, required this.potentialWrites, required this.potentialInvokes, @@ -405,9 +405,9 @@ class FieldUsage extends MemberUsage { assert((reads as dynamic) != null), assert((writes as dynamic) != null), assert((invokes as dynamic) != null), - super.cloned(field, pendingUse); + super.cloned(); - FieldUsage(FieldEntity field, + FieldUsage(FieldEntity super.field, {required this.potentialReads, required this.potentialWrites, required this.potentialInvokes}) @@ -419,7 +419,7 @@ class FieldUsage extends MemberUsage { assert((potentialReads as dynamic) != null), assert((potentialWrites as dynamic) != null), assert((potentialInvokes as dynamic) != null), - super.internal(field); + super.internal(); @override Iterable get initialConstants => _initialConstants ?? const []; @@ -532,14 +532,14 @@ class MethodUsage extends MemberUsage { assert((invokes as dynamic) != null), super.cloned(function, pendingUse); - MethodUsage(FunctionEntity function, + MethodUsage(FunctionEntity super.function, {required this.potentialReads, required this.potentialInvokes}) : reads = EnumSet(), invokes = EnumSet(), parameterUsage = ParameterUsage(function.parameterStructure), assert((potentialReads as dynamic) != null), assert((potentialInvokes as dynamic) != null), - super.internal(function); + super.internal(); @override bool get hasInvoke => invokes.isNotEmpty && parameterUsage.hasInvoke; diff --git a/pkg/compiler/pubspec.yaml b/pkg/compiler/pubspec.yaml index d25829f7504..c4e9fa34ebe 100644 --- a/pkg/compiler/pubspec.yaml +++ b/pkg/compiler/pubspec.yaml @@ -4,7 +4,7 @@ name: compiler # This package is not intended for consumption on pub.dev. DO NOT publish. publish_to: none environment: - sdk: '>=2.16.0 <3.0.0' + sdk: '>=2.17.0 <3.0.0' # Use 'any' constraints here; we get our versions from the DEPS file. dependencies: