Skip to content

Commit

Permalink
NNBD preview: Flip non-null reasons back on
Browse files Browse the repository at this point in the history
Change-Id: Idaf6adfc8a9960c8e6f6f8e421a795fdb374a921
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132163
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
  • Loading branch information
srawlins authored and commit-bot@chromium.org committed Jan 16, 2020
1 parent 356fa11 commit 93b40dc
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions pkg/analysis_server/lib/src/edit/nnbd_migration/info_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class InfoBuilder {

/// Initialize a newly created builder.
InfoBuilder(this.provider, this.includedPath, this.info, this.listener,
{this.explainNonNullableTypes = false});
{this.explainNonNullableTypes = true});

/// The analysis server used to get information about libraries.
AnalysisServer get server => listener.server;
Expand Down Expand Up @@ -463,8 +463,8 @@ class InfoBuilder {
for (var edge in edgeInfos) {
EdgeOriginInfo origin = info.edgeOrigin[edge];
if (origin == null) {
// TODO(https://github.com/dart-lang/sdk/issues/39203): I think this
// shouldn't happen? But it does on the path package.
// TODO(srawlins): I think this shouldn't happen? But it does on the
// collection and path packages.
continue;
}
NavigationTarget target =
Expand Down Expand Up @@ -519,13 +519,15 @@ class InfoBuilder {
if (upstreamTriggeredEdgeInfos.isNotEmpty) {
List<RegionDetail> details =
_computeUpstreamTriggeredDetails(upstreamTriggeredEdgeInfos);
TypeAnnotation node = nonNullableType.key;
regions.add(RegionInfo(
RegionType.nonNullableType,
mapper.map(node.offset),
node.length,
"This type is not changed; it is determined to be non-nullable",
details));
if (details.isNotEmpty) {
TypeAnnotation node = nonNullableType.key;
regions.add(RegionInfo(
RegionType.nonNullableType,
mapper.map(node.offset),
node.length,
"This type is not changed; it is determined to be non-nullable",
details));
}
}
}
}
Expand Down

0 comments on commit 93b40dc

Please sign in to comment.