Migration: enable the use of super parameters

Change-Id: Ie041191028bd0cd6c22571d1548a591f1852f89e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253861
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
This commit is contained in:
Paul Berry 2022-08-07 12:28:39 +00:00 committed by Commit Bot
parent 6abea1381b
commit fab3bc0467
16 changed files with 3896 additions and 3918 deletions

View file

@ -26,4 +26,5 @@ linter:
- empty_constructor_bodies
- empty_statements
- unnecessary_brace_in_string_interps
- use_super_parameters
- valid_regexps

View file

@ -47,8 +47,7 @@ abstract class FixReasonTarget {
class _FixReasonTarget_NamedParameter extends _FixReasonTarget_Part {
final String name;
_FixReasonTarget_NamedParameter(FixReasonTarget inner, this.name)
: super(inner);
_FixReasonTarget_NamedParameter(super.inner, this.name);
@override
int get hashCode => Object.hash(2, inner, name);
@ -76,8 +75,7 @@ abstract class _FixReasonTarget_Part extends FixReasonTarget {
class _FixReasonTarget_PositionalParameter extends _FixReasonTarget_Part {
final int index;
_FixReasonTarget_PositionalParameter(FixReasonTarget inner, this.index)
: super(inner);
_FixReasonTarget_PositionalParameter(super.inner, this.index);
@override
int get hashCode => Object.hash(1, inner, index);
@ -95,7 +93,7 @@ class _FixReasonTarget_PositionalParameter extends _FixReasonTarget_Part {
/// Fix reason target representing the return type of a function type.
class _FixReasonTarget_ReturnType extends _FixReasonTarget_Part {
_FixReasonTarget_ReturnType(FixReasonTarget inner) : super(inner);
_FixReasonTarget_ReturnType(super.inner);
@override
int get hashCode => Object.hash(3, inner);
@ -127,8 +125,7 @@ class _FixReasonTarget_Root extends FixReasonTarget {
class _FixReasonTarget_TypeArgument extends _FixReasonTarget_Part {
final int index;
_FixReasonTarget_TypeArgument(FixReasonTarget inner, this.index)
: super(inner);
_FixReasonTarget_TypeArgument(super.inner, this.index);
@override
int get hashCode => Object.hash(5, inner, index);
@ -159,7 +156,7 @@ class _FixReasonTarget_TypeArgument extends _FixReasonTarget_Part {
/// argument of type argument of" or simply "type argument". The solution is to
/// describe the fix reason target as "type argument of yielded type".
class _FixReasonTarget_YieldedType extends _FixReasonTarget_Part {
_FixReasonTarget_YieldedType(FixReasonTarget inner) : super(inner);
_FixReasonTarget_YieldedType(super.inner);
@override
int get hashCode => Object.hash(4, inner);

View file

@ -26,8 +26,8 @@ class AlreadyMigratedTypeOrigin extends EdgeOrigin {
/// Indicates whether the already-migrated type is nullable or not.
final bool isNullable;
AlreadyMigratedTypeOrigin.forElement(Element element, this.isNullable)
: super.forElement(element);
AlreadyMigratedTypeOrigin.forElement(Element super.element, this.isNullable)
: super.forElement();
@override
String get description => '${isNullable ? 'nullable' : 'non-nullable'}'
@ -50,11 +50,10 @@ class AlwaysNullableTypeOrigin extends EdgeOrigin {
/// it is the `dynamic` type).
final bool isVoid;
AlwaysNullableTypeOrigin(Source? source, AstNode node, this.isVoid)
: super(source, node);
AlwaysNullableTypeOrigin(super.source, AstNode super.node, this.isVoid);
AlwaysNullableTypeOrigin.forElement(Element element, this.isVoid)
: super.forElement(element);
AlwaysNullableTypeOrigin.forElement(Element super.element, this.isVoid)
: super.forElement();
@override
String get description =>
@ -67,7 +66,7 @@ class AlwaysNullableTypeOrigin extends EdgeOrigin {
/// Edge origin resulting from the presence of an Angular annotation such as
/// `@Optional()`, `@ViewChild(...)`, or `@ContentChild(...)`.
class AngularAnnotationOrigin extends EdgeOrigin {
AngularAnnotationOrigin(Source? source, AstNode node) : super(source, node);
AngularAnnotationOrigin(super.source, AstNode super.node);
@override
String get description =>
@ -88,8 +87,7 @@ class AngularAnnotationOrigin extends EdgeOrigin {
/// this class is used for the edge connecting the type of f's `i` parameter to
/// `never`, due to the `checkNotNull` call proclaiming that `i` is not `null`.
class ArgumentErrorCheckNotNullOrigin extends EdgeOrigin {
ArgumentErrorCheckNotNullOrigin(Source? source, SimpleIdentifier node)
: super(source, node);
ArgumentErrorCheckNotNullOrigin(super.source, SimpleIdentifier super.node);
@override
String get description => 'value checked to be non-null';
@ -100,7 +98,7 @@ class ArgumentErrorCheckNotNullOrigin extends EdgeOrigin {
/// Edge origin resulting from a use of built_value's `@nullable` annotation.
class BuiltValueNullableOrigin extends EdgeOrigin {
BuiltValueNullableOrigin(Source? source, AstNode node) : super(source, node);
BuiltValueNullableOrigin(super.source, AstNode super.node);
@override
String get description => 'method is marked with the `@nullable` annotation';
@ -112,7 +110,7 @@ class BuiltValueNullableOrigin extends EdgeOrigin {
/// An edge origin used for edges that originated because of a tear-off of
/// `call` on a function type.
class CallTearOffOrigin extends EdgeOrigin {
CallTearOffOrigin(Source? source, AstNode node) : super(source, node);
CallTearOffOrigin(super.source, AstNode super.node);
@override
String get description => 'tear-off of .call';
@ -124,8 +122,7 @@ class CallTearOffOrigin extends EdgeOrigin {
/// Edge origin resulting from the use of a value on the LHS of a compound
/// assignment.
class CompoundAssignmentOrigin extends EdgeOrigin {
CompoundAssignmentOrigin(Source? source, AssignmentExpression node)
: super(source, node);
CompoundAssignmentOrigin(super.source, AssignmentExpression super.node);
@override
String get description => 'compound assignment';
@ -140,7 +137,7 @@ class CompoundAssignmentOrigin extends EdgeOrigin {
/// Edge origin resulting from the use of an element which does not affect the
/// nullability graph in other ways.
class DummyOrigin extends EdgeOrigin {
DummyOrigin(Source? source, AstNode node) : super(source, node);
DummyOrigin(super.source, AstNode super.node);
@override
String get description => 'dummy';
@ -152,7 +149,7 @@ class DummyOrigin extends EdgeOrigin {
/// An edge origin used for edges that originated because of an assignment
/// involving a value with a dynamic type.
class DynamicAssignmentOrigin extends EdgeOrigin {
DynamicAssignmentOrigin(Source? source, AstNode? node) : super(source, node);
DynamicAssignmentOrigin(super.source, super.node);
@override
String get description => 'assignment of dynamic value';
@ -196,7 +193,7 @@ abstract class EdgeOrigin extends EdgeOriginInfo {
/// An edge origin used for edges that originated because of a reference to an
/// enum value, which cannot be null.
class EnumValueOrigin extends EdgeOrigin {
EnumValueOrigin(Source? source, AstNode node) : super(source, node);
EnumValueOrigin(super.source, AstNode super.node);
@override
String get description => 'non-nullable enum value';
@ -208,7 +205,7 @@ class EnumValueOrigin extends EdgeOrigin {
/// Edge origin resulting from an explicit or implicit `dynamic` type annotation
/// appearing in an external declaration.
class ExternalDynamicOrigin extends EdgeOrigin {
ExternalDynamicOrigin(Source? source, AstNode node) : super(source, node);
ExternalDynamicOrigin(super.source, AstNode super.node);
@override
String get description => 'dynamic type in external declaration';
@ -220,8 +217,7 @@ class ExternalDynamicOrigin extends EdgeOrigin {
/// Edge origin resulting from the relationship between a field formal parameter
/// and the corresponding field.
class FieldFormalParameterOrigin extends EdgeOrigin {
FieldFormalParameterOrigin(Source? source, FieldFormalParameter node)
: super(source, node);
FieldFormalParameterOrigin(super.source, FieldFormalParameter super.node);
@override
String get description => 'field formal parameter';
@ -237,7 +233,7 @@ class FieldFormalParameterOrigin extends EdgeOrigin {
/// that failed to initialize the field (or the class, if the constructor is
/// synthetic).
class FieldNotInitializedOrigin extends EdgeOrigin {
FieldNotInitializedOrigin(Source? source, AstNode node) : super(source, node);
FieldNotInitializedOrigin(super.source, AstNode super.node);
@override
String get description => 'field not initialized';
@ -256,8 +252,7 @@ class FieldNotInitializedOrigin extends EdgeOrigin {
/// this class is used for the edge connecting the type of `l`'s `int` type
/// parameter to the type of `i`.
class ForEachVariableOrigin extends EdgeOrigin {
ForEachVariableOrigin(Source? source, ForEachParts node)
: super(source, node);
ForEachVariableOrigin(super.source, ForEachParts super.node);
@override
String get description => 'variable in "for each" loop';
@ -268,8 +263,7 @@ class ForEachVariableOrigin extends EdgeOrigin {
/// Edge origin resulting from the relationship between a getter and a setter.
class GetterSetterCorrespondenceOrigin extends EdgeOrigin {
GetterSetterCorrespondenceOrigin(Source? source, AstNode node)
: super(source, node);
GetterSetterCorrespondenceOrigin(super.source, AstNode super.node);
@override
String get description => 'getter/setter correspondence';
@ -288,7 +282,7 @@ class GetterSetterCorrespondenceOrigin extends EdgeOrigin {
/// `x` and `y` are nullable, due to the fact that the `int` in the return type
/// is the greatest lower bound of the two other `int`s.
class GreatestLowerBoundOrigin extends EdgeOrigin {
GreatestLowerBoundOrigin(Source? source, AstNode? node) : super(source, node);
GreatestLowerBoundOrigin(super.source, super.node);
@override
String get description => 'greatest lower bound';
@ -299,7 +293,7 @@ class GreatestLowerBoundOrigin extends EdgeOrigin {
/// Edge origin resulting from the presence of a `??` operator.
class IfNullOrigin extends EdgeOrigin {
IfNullOrigin(Source? source, AstNode node) : super(source, node);
IfNullOrigin(super.source, AstNode super.node);
@override
String get description => 'if-null operator';
@ -322,8 +316,7 @@ class IfNullOrigin extends EdgeOrigin {
/// between the implicit constructor for `D` and the explicit constructor for
/// `C`.
class ImplicitMixinSuperCallOrigin extends EdgeOrigin {
ImplicitMixinSuperCallOrigin(Source? source, ClassTypeAlias node)
: super(source, node);
ImplicitMixinSuperCallOrigin(super.source, ClassTypeAlias super.node);
@override
String get description => 'implicit super call in mixin constructor';
@ -335,8 +328,7 @@ class ImplicitMixinSuperCallOrigin extends EdgeOrigin {
/// Edge origin resulting from the implicit assignment of `null` to a top level
/// variable or field that lacks an initializer.
class ImplicitNullInitializerOrigin extends EdgeOrigin {
ImplicitNullInitializerOrigin(Source? source, AstNode node)
: super(source, node);
ImplicitNullInitializerOrigin(super.source, AstNode super.node);
@override
String get description => 'uninitialized variable';
@ -348,8 +340,7 @@ class ImplicitNullInitializerOrigin extends EdgeOrigin {
/// Edge origin resulting from a `return;` statement which implicitly returns
/// `null`.
class ImplicitNullReturnOrigin extends EdgeOrigin {
ImplicitNullReturnOrigin(Source? source, ReturnStatement node)
: super(source, node);
ImplicitNullReturnOrigin(super.source, ReturnStatement super.node);
@override
String get description => 'implicit return of null';
@ -364,7 +355,7 @@ class ImplicitNullReturnOrigin extends EdgeOrigin {
/// Edge origin used for edges that arise from an implicit use of `this`, e.g.
/// during a method call from an extension.
class ImplicitThisOrigin extends EdgeOrigin {
ImplicitThisOrigin(Source? source, AstNode node) : super(source, node);
ImplicitThisOrigin(super.source, AstNode super.node);
@override
String get description => 'implicit use of `this`';
@ -376,8 +367,7 @@ class ImplicitThisOrigin extends EdgeOrigin {
/// Edge origin resulting from the inference of a type parameter, which
/// can affects the nullability of that type parameter's bound.
class InferredTypeParameterInstantiationOrigin extends EdgeOrigin {
InferredTypeParameterInstantiationOrigin(Source? source, AstNode node)
: super(source, node);
InferredTypeParameterInstantiationOrigin(super.source, AstNode super.node);
@override
String get description => 'inferred type parameter';
@ -389,7 +379,7 @@ class InferredTypeParameterInstantiationOrigin extends EdgeOrigin {
/// An edge origin used for edges that originated because of an instance
/// creation expression.
class InstanceCreationOrigin extends EdgeOrigin {
InstanceCreationOrigin(Source? source, AstNode node) : super(source, node);
InstanceCreationOrigin(super.source, AstNode super.node);
@override
String get description => 'instance creation';
@ -407,8 +397,7 @@ class InstanceCreationOrigin extends EdgeOrigin {
/// this class is used for the edge connecting the type of x's type parameter
/// with the type bound in the declaration of C.
class InstantiateToBoundsOrigin extends EdgeOrigin {
InstantiateToBoundsOrigin(Source? source, NamedType node)
: super(source, node);
InstantiateToBoundsOrigin(super.source, NamedType super.node);
@override
String get description => 'type instantiated to bounds';
@ -423,8 +412,7 @@ class InstantiateToBoundsOrigin extends EdgeOrigin {
/// Before the migration, there was no way to say `is int?`, and therefore,
/// `is int` should migrate to non-null int.
class IsCheckMainTypeOrigin extends EdgeOrigin {
IsCheckMainTypeOrigin(Source? source, TypeAnnotation node)
: super(source, node);
IsCheckMainTypeOrigin(super.source, TypeAnnotation super.node);
@override
String get description => '"is" check does not accept null';
@ -436,8 +424,7 @@ class IsCheckMainTypeOrigin extends EdgeOrigin {
/// An edge origin used for the return type of an iterator method that might be
/// changed into an extension method from package:collection.
class IteratorMethodReturnOrigin extends EdgeOrigin {
IteratorMethodReturnOrigin(Source? source, AstNode node)
: super(source, node);
IteratorMethodReturnOrigin(super.source, AstNode super.node);
@override
String get description =>
@ -450,8 +437,7 @@ class IteratorMethodReturnOrigin extends EdgeOrigin {
/// An edge origin used for the type argument of a list constructor that
/// specified an initial length, because that type argument must be nullable.
class ListLengthConstructorOrigin extends EdgeOrigin {
ListLengthConstructorOrigin(Source? source, AstNode node)
: super(source, node);
ListLengthConstructorOrigin(super.source, AstNode super.node);
@override
String get description => 'construction of list via a length';
@ -463,7 +449,7 @@ class ListLengthConstructorOrigin extends EdgeOrigin {
/// An edge origin used for edges that originated because a literal expression
/// has a known nullability.
class LiteralOrigin extends EdgeOrigin {
LiteralOrigin(Source? source, AstNode node) : super(source, node);
LiteralOrigin(super.source, AstNode super.node);
@override
String get description => 'literal expression';
@ -485,8 +471,7 @@ class LiteralOrigin extends EdgeOrigin {
/// parameter, due to the fact that the call to `f` implicitly passes a null
/// value for `i`.
class NamedParameterNotSuppliedOrigin extends EdgeOrigin {
NamedParameterNotSuppliedOrigin(Source? source, AstNode node)
: super(source, node);
NamedParameterNotSuppliedOrigin(super.source, AstNode super.node);
@override
String get description => 'named parameter not supplied';
@ -498,7 +483,7 @@ class NamedParameterNotSuppliedOrigin extends EdgeOrigin {
/// Edge origin for the nullability of an expression that whose type is fixed by
/// the language definition to be non-nullable `bool`.
class NonNullableBoolTypeOrigin extends EdgeOrigin {
NonNullableBoolTypeOrigin(Source? source, AstNode node) : super(source, node);
NonNullableBoolTypeOrigin(super.source, AstNode super.node);
@override
String get description => 'non-null boolean expression';
@ -510,8 +495,7 @@ class NonNullableBoolTypeOrigin extends EdgeOrigin {
/// Edge origin resulting from the class/superclass relationship for a class
/// whose superclass is implicitly `Object`.
class NonNullableObjectSuperclass extends EdgeOrigin {
NonNullableObjectSuperclass(Source? source, AstNode node)
: super(source, node);
NonNullableObjectSuperclass(super.source, AstNode super.node);
@override
String get description => 'implicit supertype of Object';
@ -523,7 +507,7 @@ class NonNullableObjectSuperclass extends EdgeOrigin {
/// Edge origin resulting from the usage of a value in a circumstance that
/// requires it to be non-nullable
class NonNullableUsageOrigin extends EdgeOrigin {
NonNullableUsageOrigin(Source? source, AstNode node) : super(source, node);
NonNullableUsageOrigin(super.source, AstNode super.node);
@override
String get description => 'value cannot be null';
@ -542,7 +526,7 @@ class NonNullableUsageOrigin extends EdgeOrigin {
/// this class is used for the edge connecting the type of f's `i` parameter to
/// `never`, due to the assert statement proclaiming that `i` is not `null`.
class NonNullAssertionOrigin extends EdgeOrigin {
NonNullAssertionOrigin(Source? source, Assertion node) : super(source, node);
NonNullAssertionOrigin(super.source, Assertion super.node);
@override
String get description => 'value asserted to be non-null';
@ -564,11 +548,10 @@ class NullabilityCommentOrigin extends EdgeOrigin {
/// non-nullable.
final bool isNullable;
NullabilityCommentOrigin(Source? source, AstNode node, this.isNullable)
NullabilityCommentOrigin(super.source, AstNode super.node, this.isNullable)
: assert(node is TypeAnnotation ||
node is FunctionTypedFormalParameter ||
(node is FieldFormalParameter && node.parameters != null)),
super(source, node);
(node is FieldFormalParameter && node.parameters != null));
@override
String get description =>
@ -586,8 +569,8 @@ class NullabilityCommentOrigin extends EdgeOrigin {
/// this class is used for the edge connecting `always` to the type of f's `i`
/// parameter, due to the fact that `i` is optional and has no initializer.
class OptionalFormalParameterOrigin extends EdgeOrigin {
OptionalFormalParameterOrigin(Source? source, DefaultFormalParameter node)
: super(source, node);
OptionalFormalParameterOrigin(
super.source, DefaultFormalParameter super.node);
@override
String get description => 'optional formal parameter must be nullable';
@ -599,8 +582,7 @@ class OptionalFormalParameterOrigin extends EdgeOrigin {
/// Edge origin resulting from an inheritance relationship between two method
/// parameters.
class ParameterInheritanceOrigin extends EdgeOrigin {
ParameterInheritanceOrigin(Source? source, AstNode node)
: super(source, node);
ParameterInheritanceOrigin(super.source, AstNode super.node);
@override
String get description => 'function parameter override';
@ -621,8 +603,7 @@ class ParameterInheritanceOrigin extends EdgeOrigin {
/// this class is used for the edge connecting the type of f's `i` parameter to
/// `never`, due to the `checkNotNull` call proclaiming that `i` is not `null`.
class QuiverCheckNotNullOrigin extends EdgeOrigin {
QuiverCheckNotNullOrigin(Source? source, SimpleIdentifier node)
: super(source, node);
QuiverCheckNotNullOrigin(super.source, SimpleIdentifier super.node);
@override
String get description => 'value checked to be non-null';
@ -634,8 +615,7 @@ class QuiverCheckNotNullOrigin extends EdgeOrigin {
/// Edge origin resulting from an inheritance relationship between two method
/// return types.
class ReturnTypeInheritanceOrigin extends EdgeOrigin {
ReturnTypeInheritanceOrigin(Source? source, AstNode node)
: super(source, node);
ReturnTypeInheritanceOrigin(super.source, AstNode super.node);
@override
String get description => 'function return type override';
@ -648,7 +628,7 @@ class ReturnTypeInheritanceOrigin extends EdgeOrigin {
/// directive. The type of such parameters is fixed by the language as
/// non-nullable `StackTrace`.
class StackTraceTypeOrigin extends EdgeOrigin {
StackTraceTypeOrigin(Source? source, AstNode? node) : super(source, node);
StackTraceTypeOrigin(super.source, super.node);
@override
String get description => 'stack trace variable is nullable';
@ -663,8 +643,7 @@ class ThisOrSuperOrigin extends EdgeOrigin {
/// expression in question is `super`.
final bool isThis;
ThisOrSuperOrigin(Source? source, AstNode node, this.isThis)
: super(source, node);
ThisOrSuperOrigin(super.source, AstNode super.node, this.isThis);
@override
String get description =>
@ -677,7 +656,7 @@ class ThisOrSuperOrigin extends EdgeOrigin {
/// An edge origin used for edges that originated from the type of a `throw` or
/// `rethrow`.
class ThrowOrigin extends EdgeOrigin {
ThrowOrigin(Source? source, AstNode node) : super(source, node);
ThrowOrigin(super.source, AstNode super.node);
@override
String get description =>
@ -694,7 +673,7 @@ class ThrowOrigin extends EdgeOrigin {
/// unioned with references to the nodes referring to source code. The origin of
/// those union edges will be [TypedefReferenceOrigin].
class TypedefReferenceOrigin extends EdgeOrigin {
TypedefReferenceOrigin(Source? source, NamedType node) : super(source, node);
TypedefReferenceOrigin(super.source, NamedType super.node);
@override
String get description => 'reference to typedef';
@ -706,8 +685,7 @@ class TypedefReferenceOrigin extends EdgeOrigin {
/// Edge origin resulting from the instantiation of a type parameter, which
/// affects the nullability of that type parameter's bound.
class TypeParameterInstantiationOrigin extends EdgeOrigin {
TypeParameterInstantiationOrigin(Source? source, TypeAnnotation node)
: super(source, node);
TypeParameterInstantiationOrigin(super.source, TypeAnnotation super.node);
@override
String get description => 'type parameter instantiation';
@ -722,7 +700,7 @@ class TypeParameterInstantiationOrigin extends EdgeOrigin {
/// Edge origin resulting from the read of a variable that has not been
/// definitely assigned a value.
class UninitializedReadOrigin extends EdgeOrigin {
UninitializedReadOrigin(Source? source, AstNode node) : super(source, node);
UninitializedReadOrigin(super.source, AstNode super.node);
@override
String get description => 'local variable might not be initialized';

View file

@ -985,9 +985,8 @@ class _ExtractEditPlan extends _NestedEditPlan {
/// even when [EditPlan.removeViaComments] is true.
final bool _alwaysDelete;
_ExtractEditPlan(AstNode? sourceNode, NodeProducingEditPlan innerPlan,
this._planner, this._infoBefore, this._infoAfter, this._alwaysDelete)
: super(sourceNode, innerPlan);
_ExtractEditPlan(super.sourceNode, super.innerPlan, this._planner,
this._infoBefore, this._infoAfter, this._alwaysDelete);
@override
Map<int?, List<AtomicEdit>>? _getChanges(bool parens) {
@ -1027,7 +1026,7 @@ class _ExtractEditPlan extends _NestedEditPlan {
abstract class _NestedEditPlan extends NodeProducingEditPlan {
final NodeProducingEditPlan innerPlan;
_NestedEditPlan(AstNode? sourceNode, this.innerPlan) : super._(sourceNode);
_NestedEditPlan(super.sourceNode, this.innerPlan) : super._();
@override
bool get endsInCascade => innerPlan.endsInCascade;
@ -1563,9 +1562,8 @@ class _PassThroughBuilderImpl implements PassThroughBuilder {
/// [EditPlan] representing an AstNode that is not to be changed, but may have
/// some changes applied to some of its descendants.
class _PassThroughEditPlan extends _SimpleEditPlan {
_PassThroughEditPlan._(AstNode? node, Precedence precedence,
bool endsInCascade, Map<int?, List<AtomicEdit>>? innerChanges)
: super(node, precedence, endsInCascade, innerChanges);
_PassThroughEditPlan._(
super.node, super.precedence, super.endsInCascade, super.innerChanges);
}
/// [EditPlan] applying to a [ParenthesizedExpression]. Unlike the normal
@ -1582,8 +1580,7 @@ class _ProvisionalParenEditPlan extends _NestedEditPlan {
/// structures it points to) may be incorporated into this edit plan and later
/// modified.
_ProvisionalParenEditPlan(
ParenthesizedExpression node, NodeProducingEditPlan innerPlan)
: super(node, innerPlan);
ParenthesizedExpression super.node, super.innerPlan);
@override
Map<int?, List<AtomicEdit>>? _getChanges(bool parens) {
@ -1652,8 +1649,8 @@ class _SimpleEditPlan extends NodeProducingEditPlan {
bool _finalized = false;
_SimpleEditPlan(
AstNode? node, this._precedence, this.endsInCascade, this._innerChanges)
: super._(node);
super.node, this._precedence, this.endsInCascade, this._innerChanges)
: super._();
@override
Map<int?, List<AtomicEdit>>? _getChanges(bool parens) {

View file

@ -3,7 +3,6 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/src/generated/source.dart';
import 'package:nnbd_migration/fix_reason_target.dart';
import 'package:nnbd_migration/instrumentation.dart';
import 'package:nnbd_migration/src/edge_origin.dart';
@ -36,9 +35,8 @@ class ExpressionChecksOrigin extends EdgeOrigin {
/// package.
final bool isSetupAssignment;
ExpressionChecksOrigin(Source? source, Expression? node, this.checks,
{this.isSetupAssignment = false})
: super(source, node);
ExpressionChecksOrigin(super.source, Expression? super.node, this.checks,
{this.isSetupAssignment = false});
@override
String get description => 'data flow';

View file

@ -251,8 +251,7 @@ class IntroduceThenChange extends ExpressionChange {
/// The change that should be made to the value the future completes with.
final ExpressionChange innerChange;
IntroduceThenChange(DartType resultType, this.innerChange)
: super(resultType);
IntroduceThenChange(super.resultType, this.innerChange);
@override
NullabilityFixDescription get description =>
@ -1346,7 +1345,7 @@ class NodeChangeForVariableDeclarationList
/// [ExpressionChange] describing the addition of a comment explaining that a
/// literal `null` could not be migrated.
class NoValidMigrationChange extends ExpressionChange {
NoValidMigrationChange(DartType resultType) : super(resultType);
NoValidMigrationChange(super.resultType);
@override
NullabilityFixDescription get description =>
@ -1372,7 +1371,7 @@ class NullCheckChange extends ExpressionChange {
/// The hint that is causing this `!` to be added, if any.
final HintComment? hint;
NullCheckChange(DartType resultType, {this.hint}) : super(resultType);
NullCheckChange(super.resultType, {this.hint});
@override
NullabilityFixDescription get description =>

View file

@ -128,8 +128,7 @@ class NavigationSource extends NavigationRegion {
final NavigationTarget target;
/// Initialize a newly created link.
NavigationSource(int offset, int? line, int length, this.target)
: super(offset, line, length);
NavigationSource(super.offset, super.line, super.length, this.target);
}
/// A location to which a user might want to navigate.

File diff suppressed because it is too large Load diff

View file

@ -9,8 +9,8 @@ class NavigationTreeDirectoryNode extends NavigationTreeNode {
/// Creates a navigation tree node representing a directory.
NavigationTreeDirectoryNode(
{required String? name, required String? path, required this.subtree})
: super._(name: name, path: path);
{required super.name, required super.path, required this.subtree})
: super._();
/// Returns the status by examining [subtree]:
///
@ -121,14 +121,14 @@ class NavigationTreeFileNode extends NavigationTreeNode {
/// Creates a navigation tree node representing a file.
NavigationTreeFileNode(
{required String? name,
required String? path,
{required super.name,
required super.path,
required this.href,
required this.editCount,
required this.wasExplicitlyOptedOut,
required this.migrationStatus,
required this.migrationStatusCanBeChanged})
: super._(name: name, path: path);
: super._();
NavigationTreeNodeType get type => NavigationTreeNodeType.file;

View file

@ -123,8 +123,7 @@ class _NullabilityNodeTarget_NamedParameter
extends _NullabilityNodeTarget_Part {
final String name;
_NullabilityNodeTarget_NamedParameter(NullabilityNodeTarget inner, this.name)
: super(inner);
_NullabilityNodeTarget_NamedParameter(super.inner, this.name);
@override
String get description => 'parameter $name of ${inner.description}';
@ -147,9 +146,7 @@ class _NullabilityNodeTarget_PositionalParameter
extends _NullabilityNodeTarget_Part {
final int index;
_NullabilityNodeTarget_PositionalParameter(
NullabilityNodeTarget inner, this.index)
: super(inner);
_NullabilityNodeTarget_PositionalParameter(super.inner, this.index);
@override
String get description => 'parameter $index of ${inner.description}';
@ -157,7 +154,7 @@ class _NullabilityNodeTarget_PositionalParameter
/// Nullability node target representing a function's return type.
class _NullabilityNodeTarget_ReturnType extends _NullabilityNodeTarget_Part {
_NullabilityNodeTarget_ReturnType(NullabilityNodeTarget inner) : super(inner);
_NullabilityNodeTarget_ReturnType(super.inner);
@override
String get description => 'return type of ${inner.description}';
@ -165,7 +162,7 @@ class _NullabilityNodeTarget_ReturnType extends _NullabilityNodeTarget_Part {
/// Nullability node target representing one of a class's supertypes.
class _NullabilityNodeTarget_Supertype extends _NullabilityNodeTarget_Part {
_NullabilityNodeTarget_Supertype(NullabilityNodeTarget inner) : super(inner);
_NullabilityNodeTarget_Supertype(super.inner);
@override
String get description => 'supertype of ${inner.description}';
@ -186,8 +183,7 @@ class _NullabilityNodeTarget_Text extends NullabilityNodeTarget {
class _NullabilityNodeTarget_TypeArgument extends _NullabilityNodeTarget_Part {
final int index;
_NullabilityNodeTarget_TypeArgument(NullabilityNodeTarget inner, this.index)
: super(inner);
_NullabilityNodeTarget_TypeArgument(super.inner, this.index);
@override
String get description => 'type argument $index of ${inner.description}';
@ -199,9 +195,7 @@ class _NullabilityNodeTarget_TypeFormalBound
extends _NullabilityNodeTarget_Part {
final String typeFormalName;
_NullabilityNodeTarget_TypeFormalBound(
NullabilityNodeTarget inner, this.typeFormalName)
: super(inner);
_NullabilityNodeTarget_TypeFormalBound(super.inner, this.typeFormalName);
@override
String get description =>

View file

@ -3,14 +3,13 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:nnbd_migration/src/preview/preview_page.dart';
import 'package:nnbd_migration/src/preview/preview_site.dart';
/// The page that is displayed when an invalid URL is requested.
class NotFoundPage extends PreviewPage {
/// Initialize a newly created file-not-found page within the given [site].
/// The [id] is the portion of the path to the page that follows the initial
/// slash ('/').
NotFoundPage(PreviewSite site, String id) : super(site, id);
NotFoundPage(super.site, String super.id);
@override
bool get requiresAuth => false;

View file

@ -3,14 +3,13 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:nnbd_migration/src/preview/preview_page.dart';
import 'package:nnbd_migration/src/preview/preview_site.dart';
/// The page that is displayed when a request could not be authenticated.
class UnauthorizedPage extends PreviewPage {
/// Initialize a newly created unauthorized page within the given [site].
/// The [id] is the portion of the path to the page that follows the initial
/// slash ('/').
UnauthorizedPage(PreviewSite site, String id) : super(site, id);
UnauthorizedPage(super.site, String super.id);
@override
bool get requiresAuth => false;

View file

@ -4,7 +4,7 @@ name: nnbd_migration
publish_to: none
environment:
sdk: '>=2.14.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
# Use 'any' constraints here; we get our versions from the DEPS file.
dependencies:

View file

@ -46,9 +46,7 @@ const sdkRootPathPosix = '/sdk';
/// exceptions, so that we can test they are properly propagated to top level.
class _ExceptionGeneratingInstrumentationListener
extends InstrumentationListener {
_ExceptionGeneratingInstrumentationListener(
{MigrationSummary? migrationSummary})
: super(migrationSummary: migrationSummary);
_ExceptionGeneratingInstrumentationListener({super.migrationSummary});
@override
void externalDecoratedType(Element element, DecoratedTypeInfo decoratedType) {
@ -109,8 +107,7 @@ class _MigrationCli extends MigrationCli {
class _MigrationCliRunner extends MigrationCliRunner {
Future<void> Function()? _runWhilePreviewServerActive;
_MigrationCliRunner(_MigrationCli cli, CommandLineOptions options)
: super(cli, options);
_MigrationCliRunner(_MigrationCli super.cli, super.options);
_MigrationCli get cli => super.cli as _MigrationCli;

View file

@ -304,8 +304,7 @@ class InstrumentedVariables extends Variables {
final _expressionChecks = <Expression, ExpressionChecksOrigin>{};
InstrumentedVariables(NullabilityGraph graph, TypeProvider typeProvider)
: super(graph, typeProvider);
InstrumentedVariables(super.graph, super.typeProvider);
/// Gets the [ExpressionChecks] associated with the given [expression].
ExpressionChecksOrigin? checkExpression(Expression expression) =>

View file

@ -173,7 +173,7 @@ class Playground {
/// Abstraction for a package fetched via pub.
class PubPackage extends Package {
PubPackage(String name, [String? version]) : super(name) {
PubPackage(super.name, [String? version]) {
throw UnimplementedError();
}