From 671d1db09749288df458ab01183afa2735b2122c Mon Sep 17 00:00:00 2001 From: Konstantin Shcheglov Date: Fri, 10 Dec 2021 09:01:52 -0800 Subject: [PATCH] Use 'index' to access the enum value index. --- lib/src/model/model_element.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/model/model_element.dart b/lib/src/model/model_element.dart index b17a4d1457..c895e45cfa 100644 --- a/lib/src/model/model_element.dart +++ b/lib/src/model/model_element.dart @@ -179,7 +179,7 @@ abstract class ModelElement extends Canonicalization if (e is FieldElement) { if (enclosingContainer == null) { if (e.isEnumConstant) { - var index = e.computeConstantValue().getField(e.name).toIntValue(); + var index = e.computeConstantValue().getField('index').toIntValue(); newModelElement = EnumField.forConstant(index, e, library, packageGraph, getter); } else if (e.enclosingElement is ExtensionElement) {