mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 03:07:49 +00:00
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 <kevmoo@google.com> Commit-Queue: Mayank Patke <fishythefish@google.com> Commit-Queue: Kevin Moore <kevmoo@google.com> Reviewed-by: Mayank Patke <fishythefish@google.com>
This commit is contained in:
parent
677cb7fb3e
commit
460075336b
|
@ -14,3 +14,4 @@ linter:
|
|||
- prefer_final_fields
|
||||
- prefer_if_null_operators
|
||||
- prefer_null_aware_operators
|
||||
- use_super_parameters
|
||||
|
|
|
@ -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`.
|
||||
///
|
||||
|
|
|
@ -515,10 +515,9 @@ class ListConstantValue extends ObjectConstantValue {
|
|||
@override
|
||||
final int hashCode;
|
||||
|
||||
ListConstantValue(InterfaceType type, List<ConstantValue> entries)
|
||||
ListConstantValue(super.type, List<ConstantValue> 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<ConstantValue> values)
|
||||
SetConstantValue(super.type, List<ConstantValue> 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<ConstantValue, ConstantValue>? _lookupMap;
|
||||
|
||||
MapConstantValue(
|
||||
InterfaceType type, List<ConstantValue> keys, List<ConstantValue> values)
|
||||
super.type, List<ConstantValue> keys, List<ConstantValue> 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);
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ class ClassEntityData extends EntityData<ClassEntity> {
|
|||
visitor.visitClassEntityData(entity);
|
||||
}
|
||||
|
||||
ClassEntityData(ClassEntity entity) : super(entity);
|
||||
ClassEntityData(super.entity);
|
||||
}
|
||||
|
||||
class ClassTypeEntityData extends EntityData<ClassEntity> {
|
||||
|
@ -35,7 +35,7 @@ class ClassTypeEntityData extends EntityData<ClassEntity> {
|
|||
visitor.visitClassTypeEntityData(entity);
|
||||
}
|
||||
|
||||
ClassTypeEntityData(ClassEntity entity) : super(entity);
|
||||
ClassTypeEntityData(super.entity);
|
||||
}
|
||||
|
||||
class MemberEntityData extends EntityData<MemberEntity> {
|
||||
|
@ -44,7 +44,7 @@ class MemberEntityData extends EntityData<MemberEntity> {
|
|||
visitor.visitMemberEntityData(entity);
|
||||
}
|
||||
|
||||
MemberEntityData(MemberEntity entity) : super(entity);
|
||||
MemberEntityData(super.entity);
|
||||
}
|
||||
|
||||
class LocalFunctionEntityData extends EntityData<Local> {
|
||||
|
@ -56,7 +56,7 @@ class LocalFunctionEntityData extends EntityData<Local> {
|
|||
@override
|
||||
bool get needsRecursiveUpdate => false;
|
||||
|
||||
LocalFunctionEntityData(Local entity) : super(entity);
|
||||
LocalFunctionEntityData(super.entity);
|
||||
}
|
||||
|
||||
class ConstantEntityData extends EntityData<ConstantValue> {
|
||||
|
@ -65,7 +65,7 @@ class ConstantEntityData extends EntityData<ConstantValue> {
|
|||
visitor.visitConstantEntityData(entity);
|
||||
}
|
||||
|
||||
ConstantEntityData(ConstantValue entity) : super(entity);
|
||||
ConstantEntityData(super.entity);
|
||||
}
|
||||
|
||||
/// A registry used to canonicalize [EntityData].
|
||||
|
|
|
@ -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<String, dynamic> toJson() {
|
||||
|
@ -117,7 +117,7 @@ class CombinerNode extends NamedNode {
|
|||
final CombinerType type;
|
||||
final Set<ReferenceNode> nodes;
|
||||
|
||||
CombinerNode(String name, this.type, this.nodes) : super(name);
|
||||
CombinerNode(super.name, this.type, this.nodes);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -196,7 +196,7 @@ abstract class BufferedCodeOutput {
|
|||
class CodeBuffer extends AbstractCodeOutput implements BufferedCodeOutput {
|
||||
StringBuffer buffer = StringBuffer();
|
||||
|
||||
CodeBuffer([List<CodeOutputListener>? listeners]) : super(listeners);
|
||||
CodeBuffer([super.listeners]);
|
||||
|
||||
@override
|
||||
void _addInternal(String text) {
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -98,24 +98,15 @@ class KernelScopeInfo {
|
|||
|
||||
class KernelCapturedScope extends KernelScopeInfo {
|
||||
KernelCapturedScope(
|
||||
Set<ir.VariableDeclaration> boxedVariables,
|
||||
NodeBox? capturedVariablesAccessor,
|
||||
Set<ir.VariableDeclaration> localsUsedInTryOrSync,
|
||||
Set<ir.Node /* VariableDeclaration | TypeVariableTypeWithContext */ >
|
||||
freeVariables,
|
||||
Map<TypeVariableTypeWithContext, Set<VariableUse>> freeVariablesForRti,
|
||||
bool thisUsedAsFreeVariable,
|
||||
Set<VariableUse> 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.
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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<ir.DartType>? 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<ir.DartType>? 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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<ParameterStubMethod> 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<ParameterStubMethod> 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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -166,13 +166,8 @@ class NativeResolutionEnqueuer extends NativeEnqueuer {
|
|||
/// and exactly one of [unusedClasses] and [registeredClasses].
|
||||
final Set<ClassEntity> _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<ClassEntity> get nativeClassesForTesting => _nativeClasses;
|
||||
|
||||
|
@ -209,14 +204,13 @@ class NativeCodegenEnqueuer extends NativeEnqueuer {
|
|||
final Set<ClassEntity> _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<Uri> libraries) {
|
||||
|
|
|
@ -278,7 +278,7 @@ class PropertyUsage extends MemberUsage {
|
|||
@override
|
||||
final EnumSet<Access> invokes;
|
||||
|
||||
PropertyUsage.cloned(MemberEntity member, EnumSet<MemberUse> 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<MemberUse> read(EnumSet<Access> accesses) {
|
||||
|
@ -390,7 +390,7 @@ class FieldUsage extends MemberUsage {
|
|||
|
||||
List<ConstantValue>? _initialConstants;
|
||||
|
||||
FieldUsage.cloned(FieldEntity field, EnumSet<MemberUse> 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<ConstantValue> 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;
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue