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

Need to make sure Meta.get_annotation will work for a constructor. #6612

Closed
jdunkerley opened this issue May 9, 2023 · 2 comments · Fixed by #6633
Closed

Need to make sure Meta.get_annotation will work for a constructor. #6612

jdunkerley opened this issue May 9, 2023 · 2 comments · Fixed by #6633
Assignees
Labels
-compiler x-new-feature Type: new feature request

Comments

@jdunkerley
Copy link
Member

  • value will be the type class.
  • call_name will be the constructor name.

Want to ensure can get the associated annotations for the fields.

type My_Type
    @encoding Encoding.default_widget
    Value encoding:Encoding

Meta.get_annotation My_Type "Value" "encoding" == Encoding.default_widget
@jdunkerley jdunkerley added x-new-feature Type: new feature request -compiler labels May 9, 2023
@github-project-automation github-project-automation bot moved this to ❓New in Issues Board May 9, 2023
@jdunkerley jdunkerley added this to the Design Partners milestone May 9, 2023
@jdunkerley jdunkerley moved this from ❓New to 📤 Backlog in Issues Board May 9, 2023
@JaroslavTulach
Copy link
Member

Surprisingly the following program delivers the default value for encoding:

from Standard.Base import all

type My_Type
    @encoding Encoding.default_widget
    Value encoding:Encoding

main =
    x = My_Type.Value Nothing
    v = Meta.get_annotation x "Value" "encoding"
    v.to_text

@JaroslavTulach JaroslavTulach moved this from 📤 Backlog to 🔧 Implementation in Issues Board May 10, 2023
@JaroslavTulach JaroslavTulach moved this from 🔧 Implementation to 👁️ Code review in Issues Board May 10, 2023
@mergify mergify bot closed this as completed in #6633 May 10, 2023
mergify bot pushed a commit that referenced this issue May 10, 2023
Fixes #6612 by searching for the atom constructor on the `target` itself, not its type.
@github-project-automation github-project-automation bot moved this from 👁️ Code review to 🟢 Accepted in Issues Board May 10, 2023
@enso-bot
Copy link

enso-bot bot commented May 11, 2023

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

Progress: - Fixed Meta.get_annotation for constructors: #6633
- Endless fighting with BindingsMap in PR-6584 - will have to go on
- type parameters as ascribed types: 5522b68
- review: #6577
- standups, meetings It should be finished by 2023-05-11.

Next Day: Fix #6609 and continue fighting with BindingsMap.

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