Since https://dart-review.googlesource.com/c/sdk/+/133422 has
introduced the possibility that a node previously marked as
non-nullable would later be marked as nullable, we need to make sure
that doesn't happen for types that have been explicitly marked as
non-nullable using a "/*!*/" hint, or types that are non-nullable in
an already-migrated library.
This required refactoring the state of nullability nodes slightly.
Nodes can now be in six states:
1. Non-nullable (previously called "undetermined")
2. Non-nullable, with non-nullable intent (previously called
"nonNullable")
3. Nullable
4. Nullable, with non-nullable intent (previously indistinguishable
from 3)
5. Exact nullable
6. Exact nullable, with non-nullable intent (previously
indistinguishable from 5)
To allow all these states to be distinguished, we separate the state
into two orthogonal parts: a "nullability" part and a "non-null
intent" part.
Change-Id: I588a2e63eaa76e3992fdfbaaa2e8b212cc1f60d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133440
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
This interface is a callback interface that allows the client to
receive detailed information about the decisions made by the migration
tool, and the source code locations associated with those decisions.
The idea is that a client of this interface can put together a report
to the user to help them understand the behavior of the migration
tool.
The instrumentation interface mostly exposes internals of the
migration engine through some safe, non-destructive interfaces. The
interface itself is documented in the new file
pkg/nnbd_migration/lib/instrumentation.dart. For examples of what
information the client can expect to receive through the
instrumentation interface, see the new file
pkg/nnbd_migration/test/instrumentation_test.dart.
Change-Id: I079551922bff75e0e8d290819f31533c29d7b62f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117285
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>