Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LibraryReader.classElements should include enums #388

Closed
simolus3 opened this issue Dec 12, 2018 · 1 comment
Closed

LibraryReader.classElements should include enums #388

simolus3 opened this issue Dec 12, 2018 · 1 comment

Comments

@simolus3
Copy link
Contributor

The iterable obtained from LibraryReader.classElements does not contain enum classes defined in the respective compilation unit. Given that enums are also represented with a ClassElement from the analyzer, I would expect them to be included.
I see that the documentation specifically points out that class elements defined in the library will be returned, but I think that this makes the name classElements a bit confusing. Perhaps there should be a getter classes, one for enums and one for both?

@natebosch
Copy link
Member

I think it could be considered breaking to start including enums in the result for classElements. I like the idea of splitting them but I think we might skip on having a single getter that returns both. You can get that with: libraryReader.classes.followedBy(libraryReader.enums)

natebosch added a commit that referenced this issue Dec 12, 2018
Fixes #388

Deprecate the `classElements` getter since it is ambiguous, both classes
and enums are represented by `ClassElement` in analyzer, but we don't
want to exclusively always mix them in this interface. Add the name
`classes` to be more specific. Add an implementation for `enums.`
natebosch added a commit that referenced this issue Dec 12, 2018
Fixes #388

Deprecate the `classElements` getter since it is ambiguous, both classes
and enums are represented by `ClassElement` in analyzer, but we don't
want to exclusively always mix them in this interface. Add the name
`classes` to be more specific. Add an implementation for `enums.`
mosuem pushed a commit to dart-lang/build that referenced this issue Dec 10, 2024
Fixes dart-lang/source_gen#388

Deprecate the `classElements` getter since it is ambiguous, both classes
and enums are represented by `ClassElement` in analyzer, but we don't
want to exclusively always mix them in this interface. Add the name
`classes` to be more specific. Add an implementation for `enums.`
mosuem pushed a commit to dart-lang/build that referenced this issue Dec 10, 2024
Fixes dart-lang/source_gen#388

Deprecate the `classElements` getter since it is ambiguous, both classes
and enums are represented by `ClassElement` in analyzer, but we don't
want to exclusively always mix them in this interface. Add the name
`classes` to be more specific. Add an implementation for `enums.`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants