Skip to content

Commit da3e12f

Browse files
scheglovCommit Queue
authored andcommitted
Elements. For LocalVariableFragment enclosingFragment can be anything, not only ExecutableFragment.
For example, here it is the top-level variable fragment. ``` final a = [for (final value in []) value * 2]; ``` Change-Id: I0c09c890256b624a28c1d55fffbfd94f9431b83e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/398928 Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent fcd4d86 commit da3e12f

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

pkg/analyzer/lib/dart/element/element2.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1816,9 +1816,6 @@ abstract class LocalVariableFragment
18161816
@override
18171817
LocalVariableElement2 get element;
18181818

1819-
@override
1820-
ExecutableFragment? get enclosingFragment;
1821-
18221819
/// Whether the variable has an initializer at declaration.
18231820
bool get hasInitializer;
18241821

pkg/analyzer/lib/src/dart/element/element.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7322,8 +7322,7 @@ class LocalVariableElementImpl extends NonParameterVariableElementImpl
73227322
LocalVariableElement2 get element => _element2;
73237323

73247324
@override
7325-
ExecutableFragment get enclosingFragment =>
7326-
enclosingElement3 as ExecutableFragment;
7325+
Fragment get enclosingFragment => enclosingElement3 as Fragment;
73277326

73287327
@override
73297328
String get identifier {

0 commit comments

Comments
 (0)