Remove a few more usages of NullabilityNode._nullable.
This will allow us to switch to the new nullability migration algorithm.
Change-Id: I0246275aa07243f809fa490fdeb6b729e407c9c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102385
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
diff --git a/pkg/analysis_server/lib/src/nullability/nullability_node.dart b/pkg/analysis_server/lib/src/nullability/nullability_node.dart
index b0d963f..d9ed674 100644
--- a/pkg/analysis_server/lib/src/nullability/nullability_node.dart
+++ b/pkg/analysis_server/lib/src/nullability/nullability_node.dart
@@ -98,7 +98,8 @@
/// Gets a string that can be appended to a type name during debugging to help
/// annotate the nullability of that type.
- String get debugSuffix => _nullable == null ? '' : '?($_nullable)';
+ String get debugSuffix =>
+ this == always ? '?' : this == never ? '' : '?($this)';
/// After constraint solving, this getter can be used to query whether the
/// type associated with this node should be considered nullable.
@@ -199,7 +200,7 @@
var additionalConditions = <ConstraintVariable>[];
graph.connect(sourceNode, destinationNode,
guards: guards, unconditional: !inConditionalControlFlow);
- if (sourceNode._nullable != null) {
+ if (sourceNode != NullabilityNode.never) {
additionalConditions.add(sourceNode._nullable);
var destinationNonNullIntent = destinationNode.nonNullIntent;
// nullable_src => nullable_dst | check_expr