Skip to content

Conversation

@pikinier20
Copy link
Contributor

No description provided.

def declarations: List[Symbol]

/** All members declared or inherited */
def allMembers: List[Symbol]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like in the documentation of Type#allMembers, we should mention that this can be slow to compute.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need then to update other methods documentation that use in their implementation Type#allMembers

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even better would be to fix these methods to not call allMembers :) Instead, we should be able to use memberDenots in most cases

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should make this an iterator. We already do this for allOverriddenSymbols which has a similar complexity.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method should also be marked as @experimental

@nicolasstucki
Copy link
Contributor

Part of #13371

self.typeRef.info.decls.toList

def allMembers: List[Symbol] =
lookupPrefix.allMembers.iterator.map(_.symbol).collect {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the test I added, the order of the members is not deterministic.

@pikinier20
Copy link
Contributor Author

For now, we'll stick to internal compiler API in terms of this method.

@pikinier20 pikinier20 closed this Apr 25, 2022
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

Successfully merging this pull request may close these issues.

3 participants