Skip to content

Wrong name used to access the index field of enumeration constants #2318

Closed
@bwilkerson

Description

@bwilkerson

In at least one place:

new ModelElement.fromPropertyInducingElement (package:dartdoc/src/model/model_element.dart:203:65)

this package is assuming that every enumeration constant has a field whose name is the same as the name of the constant and whose value is the index of the constant. That isn't true; the field is named index. We need to fix the analyzer to stop producing a representation of such a field, but we can't do so until this package stops depending on the existence of that field.

The easiest way to test that all such locations have been fixed might be to update the version of analyzer being used by dartdoc to stop producing the invalid field. The code that produces the field is, as of this writing, at pkg/analyzer/lib/src/dart/element/element.dart:1778.

Metadata

Metadata

Assignees

Labels

P2A bug or feature request we're likely to work ontype-code-healthInternal changes to our tools and workflows to make them cleaner, simpler, or more maintainable

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions