Sort declarations in edge_origin.dart

Change-Id: I8a410be295191abbaa332b0d626abd5320d32fb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159585
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This commit is contained in:
Paul Berry 2020-08-21 16:58:20 +00:00 committed by commit-bot@chromium.org
parent 09a9026cf6
commit e8577913eb

View file

@ -64,6 +64,27 @@ class AlwaysNullableTypeOrigin extends EdgeOrigin {
EdgeOriginKind get kind => EdgeOriginKind.alwaysNullableType;
}
/// Edge origin resulting from the presence of a call to
/// `ArgumentError.checkNotNull`.
///
/// For example, in the following code snippet:
/// void f(int i) {
/// ArgumentError.checkNotNull(i);
/// }
///
/// 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);
@override
String get description => 'value checked to be non-null';
@override
EdgeOriginKind get kind => EdgeOriginKind.argumentErrorCheckNotNull;
}
/// Edge origin resulting from the use of a value on the LHS of a compound
/// assignment.
class CompoundAssignmentOrigin extends EdgeOrigin {
@ -80,6 +101,18 @@ class CompoundAssignmentOrigin extends EdgeOrigin {
AssignmentExpression get node => super.node as AssignmentExpression;
}
/// 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);
@override
String get description => 'dummy';
@override
EdgeOriginKind get kind => EdgeOriginKind.dummy;
}
/// An edge origin used for edges that originated because of an assignment
/// involving a value with a dynamic type.
class DynamicAssignmentOrigin extends EdgeOrigin {
@ -430,49 +463,6 @@ class NonNullAssertionOrigin extends EdgeOrigin {
EdgeOriginKind get kind => EdgeOriginKind.nonNullAssertion;
}
/// Edge origin resulting from the presence of a call to quiver's
/// `checkNotNull`.
///
/// For example, in the following code snippet:
/// import 'package:quiver/check.dart';
/// void f(int i) {
/// checkNotNull(i);
/// }
///
/// 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);
@override
String get description => 'value checked to be non-null';
@override
EdgeOriginKind get kind => EdgeOriginKind.quiverCheckNotNull;
}
/// Edge origin resulting from the presence of a call to
/// `ArgumentError.checkNotNull`.
///
/// For example, in the following code snippet:
/// void f(int i) {
/// ArgumentError.checkNotNull(i);
/// }
///
/// 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);
@override
String get description => 'value checked to be non-null';
@override
EdgeOriginKind get kind => EdgeOriginKind.argumentErrorCheckNotNull;
}
/// Edge origin resulting from the presence of an explicit nullability hint
/// comment.
///
@ -518,18 +508,6 @@ class OptionalFormalParameterOrigin extends EdgeOrigin {
EdgeOriginKind get kind => EdgeOriginKind.optionalFormalParameter;
}
/// 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);
@override
String get description => 'dummy';
@override
EdgeOriginKind get kind => EdgeOriginKind.dummy;
}
/// Edge origin resulting from an inheritance relationship between two method
/// parameters.
class ParameterInheritanceOrigin extends EdgeOrigin {
@ -542,6 +520,28 @@ class ParameterInheritanceOrigin extends EdgeOrigin {
EdgeOriginKind get kind => EdgeOriginKind.parameterInheritance;
}
/// Edge origin resulting from the presence of a call to quiver's
/// `checkNotNull`.
///
/// For example, in the following code snippet:
/// import 'package:quiver/check.dart';
/// void f(int i) {
/// checkNotNull(i);
/// }
///
/// 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);
@override
String get description => 'value checked to be non-null';
@override
EdgeOriginKind get kind => EdgeOriginKind.quiverCheckNotNull;
}
/// Edge origin resulting from an inheritance relationship between two method
/// return types.
class ReturnTypeInheritanceOrigin extends EdgeOrigin {