Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit b449fe4

Browse files
scheglovCommit Bot
authored andcommitted
Issue 48124. Set enclosingElement for synthetic FieldElementImpl in top-merge.
Bug: dart-lang/sdk#48124 Change-Id: I0ad7cfe46edd4333fe292c7ddbe1b0044335ec0a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/228723 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent df2e8fe commit b449fe4

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,7 @@ class InheritanceManager3 {
863863
result.parameters = resultType.parameters;
864864

865865
var field = FieldElementImpl(variableName, -1);
866+
field.enclosingElement = targetClass;
866867
if (firstAccessor.isGetter) {
867868
field.getter = result;
868869
field.type = result.returnType;

pkg/analyzer/test/src/dart/element/inheritance_manager3_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,6 +1425,7 @@ class _InheritanceManager3Base extends PubPackageResolutionTest {
14251425

14261426
if (element is PropertyAccessorElement) {
14271427
var variable = element.variable;
1428+
expect(variable.enclosingElement, same(element.enclosingElement));
14281429
expect(variable.name, element.displayName);
14291430
if (element.isGetter) {
14301431
expect(variable.type, element.returnType);

0 commit comments

Comments
 (0)