Skip to content

Commit 165e097

Browse files
scheglovsrawlins
andauthored
Use 'index' to access the enum value index. (#2865)
Co-authored-by: Sam Rawlins <[email protected]>
1 parent 01694d4 commit 165e097

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/src/model/model_element.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ abstract class ModelElement extends Canonicalization
179179
if (e is FieldElement) {
180180
if (enclosingContainer == null) {
181181
if (e.isEnumConstant) {
182-
var index = e.computeConstantValue().getField(e.name).toIntValue();
182+
var index = e.computeConstantValue().getField('index').toIntValue();
183183
newModelElement =
184184
EnumField.forConstant(index, e, library, packageGraph, getter);
185185
} else if (e.enclosingElement is ExtensionElement) {

0 commit comments

Comments
 (0)