mirror of
https://github.com/dart-lang/sdk
synced 2024-10-07 08:39:41 +00:00
Implement isEnumConstant in ConstFieldElementImpl_EnumValue.
Change-Id: Icbb2dac7db5299a72294f31e119000bd8f535516 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/222100 Reviewed-by: Samuel Rawlins <srawlins@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
parent
370a9d7b78
commit
24e681927a
|
@ -1296,6 +1296,9 @@ class ConstFieldElementImpl_EnumValue extends ConstFieldElementImpl_ofEnum {
|
|||
@override
|
||||
bool get hasInitializer => false;
|
||||
|
||||
@override
|
||||
bool get isEnumConstant => true;
|
||||
|
||||
@override
|
||||
Element get nonSynthetic => this;
|
||||
|
||||
|
@ -3284,10 +3287,7 @@ class FieldElementImpl extends PropertyInducingElementImpl
|
|||
}
|
||||
|
||||
@override
|
||||
bool get isEnumConstant =>
|
||||
enclosingElement is ClassElement &&
|
||||
(enclosingElement as ClassElement).isEnum &&
|
||||
!isSynthetic;
|
||||
bool get isEnumConstant => false;
|
||||
|
||||
@override
|
||||
bool get isExternal {
|
||||
|
|
|
@ -173,7 +173,8 @@ class BundleWriter {
|
|||
_sink._writeStringReference(element.name);
|
||||
_resolutionSink._writeAnnotationList(element.metadata);
|
||||
|
||||
var constants = element.fields.where((e) => !e.isSynthetic).toList();
|
||||
var constants =
|
||||
element.fields.whereType<ConstFieldElementImpl_EnumValue>().toList();
|
||||
_writeList<FieldElement>(constants, (field) {
|
||||
_sink._writeStringReference(field.name);
|
||||
_resolutionSink._writeAnnotationList(field.metadata);
|
||||
|
|
Loading…
Reference in a new issue