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

.methods on a Type are not returning the static methods of the type. #6748

Closed
jdunkerley opened this issue May 18, 2023 · 6 comments · Fixed by #6938
Closed

.methods on a Type are not returning the static methods of the type. #6748

jdunkerley opened this issue May 18, 2023 · 6 comments · Fixed by #6938
Assignees
Labels
-compiler x-new-feature Type: new feature request

Comments

@jdunkerley
Copy link
Member

Meta.meta Locale . methods only includes the instance methods.

To access the static methods it is necessary to get the eiganType and then call methods. The methods method should allow us to get the static methods (or not) - maybe include_static:Boolean=False and we can then opt in.

Current workaround:

    operator2 = Meta.meta Locale
    operator21 = operator2.value ...
    operator211 = Meta.type_of operator21
    operator3 = Meta.Type.Value operator211
    operator5 = operator3.methods
@jdunkerley jdunkerley added -compiler x-new-feature Type: new feature request triage labels May 18, 2023
@JaroslavTulach JaroslavTulach self-assigned this May 18, 2023
@JaroslavTulach JaroslavTulach moved this from ❓New to 📤 Backlog in Issues Board May 19, 2023
@JaroslavTulach
Copy link
Member

JaroslavTulach commented May 19, 2023

Meta.meta (Meta.type_of Locale) . methods seems to work as well:

> Meta.meta Locale . methods
>>> ['display_language', 'country', 'to_display_text', 'variant', 'display_country',
'language', 'to_text', 'display_variant', 'java_locale']
> Meta.meta (Meta.type_of Locale) . methods
>>> ['display_language', 'country', 'from_language_tag', 'canada_english',
'brazil', 'japan', 'india_english', 'germany', 'poland', 'pakistan_english',
'display_country', 'language', 'pakistan_urdu', 'default', 'russia', 'uk', 'variant', 'france', 'to_text',
'from_java', 'display_variant', 'italy', 'us', 'new', 'nigeria', 'south_korea', 'indonesia', 'mexico',
'to_display_text', 'china', 'Value', 'bangladesh', 'india_hindi', 'canada_french']

isn't Meta.meta (Meta.type_of Locale) . methods sufficiently good? Shouldn't I just update the documentation to describe how to get instance and how to get static methods?

@jdunkerley
Copy link
Member Author

Lets add as an example to the docs.

@jdunkerley jdunkerley added this to the Design Partners milestone May 30, 2023
@JaroslavTulach JaroslavTulach moved this from 📤 Backlog to 👁️ Code review in Issues Board Jun 2, 2023
@enso-bot
Copy link

enso-bot bot commented Jun 3, 2023

Jaroslav Tulach reports a new STANDUP for yesterday (2023-06-02):

Progress: - review of annotations in suggestionDB: #6924 (review)

Next Day: Imports & Runtime Type Checks

@enso-bot
Copy link

enso-bot bot commented Jun 4, 2023

Jaroslav Tulach reports a new STANDUP for yesterday (2023-06-03):

Progress: - Addressing comments for Meta.methods: #6938

Next Day: Imports & Runtime Type Checks

@enso-bot
Copy link

enso-bot bot commented Jun 5, 2023

Jaroslav Tulach reports a new STANDUP for yesterday (2023-06-04):

Progress: - another usecase for "snapshot taking" infra: #6775 (comment)

Next Day: Imports & Runtime Type Checks

@enso-bot
Copy link

enso-bot bot commented Jun 6, 2023

Jaroslav Tulach reports a new STANDUP for yesterday (2023-06-05):

Progress: - Import&Export written in Java: 06bc6b7

Next Day: Imports & Runtime Type Checks

@mergify mergify bot closed this as completed in #6938 Jun 6, 2023
mergify bot pushed a commit that referenced this issue Jun 6, 2023
Fixes #6748 by documenting how to obtain all static methods available on a `Type`.
@github-project-automation github-project-automation bot moved this from 👁️ Code review to 🟢 Accepted in Issues Board Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-compiler x-new-feature Type: new feature request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants