Skip to content

Commit e7c590b

Browse files
srawlinsCommit Queue
authored andcommitted
Make some bool fields in nullability_node non-nullable
Change-Id: If50538f4e4c189d45af0a2c22e7a6a19a29c7f68 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265080 Auto-Submit: Samuel Rawlins <srawlins@google.com> Commit-Queue: Paul Berry <paulberry@google.com> Reviewed-by: Paul Berry <paulberry@google.com>
1 parent e20d10e commit e7c590b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

pkg/nnbd_migration/lib/src/nullability_node.dart

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,17 @@ class NullabilityEdge implements EdgeInfo {
8484
final String description;
8585

8686
/// Whether this edge is the result of an uninitialized variable declaration.
87-
final bool? isUninit;
87+
final bool isUninit;
8888

8989
/// Whether this edge is the result of an assignment within the test package's
9090
/// `setUp` function.
91-
final bool? isSetupAssignment;
91+
final bool isSetupAssignment;
9292

9393
NullabilityEdge._(
9494
this.destinationNode, this.upstreamNodes, this._kind, this.description,
95-
{this.codeReference, this.isUninit, this.isSetupAssignment});
95+
{this.codeReference,
96+
this.isUninit = false,
97+
this.isSetupAssignment = false});
9698

9799
@override
98100
Iterable<NullabilityNode?> get guards => upstreamNodes.skip(1);
@@ -964,11 +966,11 @@ class _PropagationState {
964966
var edge = step.edge;
965967
if (!edge.isTriggered) continue;
966968
var node = edge.destinationNode;
967-
if (edge.isUninit! && !node.isNullable) {
969+
if (edge.isUninit && !node.isNullable) {
968970
// [edge] is an edge from always to an uninitialized variable
969971
// declaration.
970972
var isSetupAssigned = node.upstreamEdges
971-
.any((e) => e is NullabilityEdge && e.isSetupAssignment!);
973+
.any((e) => e is NullabilityEdge && e.isSetupAssignment);
972974

973975
// Whether all downstream edges go to nodes with non-null intent.
974976
var allDownstreamHaveNonNullIntent = false;

0 commit comments

Comments
 (0)