Skip to content

Commit 988b50d

Browse files
pqCommit Queue
authored andcommitted
[element model] fix enclosingElement2 for labels
Chatting with Konstantin, it seems like returning null here (as we do for local functions) is the appropriate response. Addresses breakage seen in: https://github.com/dart-lang/core/actions/runs/11939711347/job/33280807310#step:6:150 Change-Id: Iaafef66f2c66ceb95ddce34d4a4bd119a9b2b93c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396702 Commit-Queue: Phil Quitslund <[email protected]> Auto-Submit: Phil Quitslund <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]>
1 parent 723c856 commit 988b50d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6418,8 +6418,7 @@ class LabelElementImpl2 extends ElementImpl2
64186418
LabelElement2 get baseElement => this;
64196419

64206420
@override
6421-
ExecutableElement2? get enclosingElement2 =>
6422-
super.enclosingElement2 as ExecutableElement2?;
6421+
ExecutableElement2? get enclosingElement2 => null;
64236422

64246423
@override
64256424
LabelFragment get firstFragment => _wrappedElement;

0 commit comments

Comments
 (0)