Migration: make the element type of _ScopedLocalSet non-nullable.

Previously, _ScopedLocalSet extended ScopedSet<Element?>, but this was
unnecessary; it was an artifact of the fact that the migration tool
was migrated to null safety in a conservative way.  We know that all
elements of a _ScopedLocalSet are non-null elements because they all
represent actual variables declared in the user's code.

Change-Id: I4d0c86997ff3c783cee6ea84cff80363e14c3060
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206670
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This commit is contained in:
Paul Berry 2021-07-14 16:30:30 +00:00 committed by commit-bot@chromium.org
parent de918b2a0c
commit 0a064b9ed7

View file

@ -2004,7 +2004,7 @@ class EdgeBuilder extends GeneralizingAstVisitor<DecoratedType>
//
// We cannot make a hard edge from y to never in this case.
if (node.variables.length == 1) {
_postDominatedLocals.add(node.variables.single.declaredElement);
_postDominatedLocals.add(node.variables.single.declaredElement!);
}
return null;
@ -3776,7 +3776,7 @@ class _ConditionInfo {
/// A [ScopedSet] specific to the [Element]s of locals/parameters.
///
/// Contains helpers for dealing with expressions as if they were elements.
class _ScopedLocalSet extends ScopedSet<Element?> {
class _ScopedLocalSet extends ScopedSet<Element> {
/// The synthetic element we use as a stand-in for `this` when analyzing
/// extension methods.
Element get extensionThis => DynamicElementImpl.instance;