Skip to content

Commit 0180cf4

Browse files
scheglovCommit Queue
authored andcommitted
Elements. Make ConstructorElementImpl implement ConstantEvaluationTarget, and ConstructorElementMixin2 not.
Change-Id: I1359d86a4c6b6ad0c2c31c30677703f9e0315773 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/437888 Reviewed-by: Paul Berry <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent a947032 commit 0180cf4

File tree

3 files changed

+2
-12
lines changed

3 files changed

+2
-12
lines changed

pkg/analyzer/lib/src/dart/constant/evaluation.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,6 @@ class ConstantEvaluationEngine {
8686
constant = element.declaration as ConstantEvaluationTarget;
8787
}
8888

89-
if (constant case ConstructorElementMixin2 constructor) {
90-
constant = constructor.baseElement;
91-
}
92-
9389
var library = constant.library as LibraryElementImpl;
9490
if (constant is FormalParameterElementImpl) {
9591
var defaultValue = constant.constantInitializer2?.expression;

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ class ConstructorElementImpl extends ExecutableElementImpl
749749
FragmentedElementMixin<ConstructorFragmentImpl>,
750750
ConstructorElementMixin2,
751751
_HasSinceSdkVersionMixin
752-
implements ConstructorElement {
752+
implements ConstantEvaluationTarget, ConstructorElement {
753753
@override
754754
final Reference reference;
755755

@@ -931,10 +931,7 @@ class ConstructorElementImpl extends ExecutableElementImpl
931931

932932
/// Common implementation for methods defined in [ConstructorElement].
933933
mixin ConstructorElementMixin2
934-
implements
935-
ConstantEvaluationTarget,
936-
ExecutableElement2OrMember,
937-
ConstructorElement {
934+
implements ExecutableElement2OrMember, ConstructorElement {
938935
@override
939936
ConstructorElementImpl get baseElement;
940937

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ class ConstructorMember extends ExecutableMember
6464
@override
6565
bool get isConst => declaration.isConst;
6666

67-
@override
68-
bool get isConstantEvaluated => declaration.isConstantEvaluated;
69-
7067
@override
7168
bool get isDefaultConstructor => baseElement.isConst;
7269

0 commit comments

Comments
 (0)