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

Coerce passed type to TS before invoking ::name() #318

Merged
merged 2 commits into from
May 17, 2024

Conversation

paultag
Copy link
Contributor

@paultag paultag commented May 17, 2024

If we're running the macro on a type which has an in-scope trait containing a ::name member, the compiler will not know which to invoke.

This clarifies that in the macro's context, we want to invoke the TS::name trait method by first casting the argument to the TS trait.

This pattern is in some other parts of the macro, I think this one wasn't triggered previously.

Goal

What is this PR attempting to achieve? Is it a bug fix? Is it related to an issue?
Closes #

Changes

How did you go about solving the problem?

Checklist

  • I have followed the steps listed in the Contributing guide.
  • If necessary, I have added documentation related to the changes made.
  • I have added or updated the tests related to the changes made.

paultag and others added 2 commits May 17, 2024 11:49
If we're running the macro on a type which has an in-scope trait
containing a `::name` member, the compiler will not know which to
invoke.

This clarifies that in the macro's context, we want to invoke the
TS::name trait method by first casting the argument to the TS trait.

This pattern is in some other parts of the macro, I think this one was
just triggered previously.

Signed-off-by: Paul R. Tagliamonte <paultag@gmail.com>
@NyxCode
Copy link
Collaborator

NyxCode commented May 17, 2024

Thanks, appreciate it!

@NyxCode NyxCode merged commit c5109a0 into Aleph-Alpha:main May 17, 2024
7 checks passed
@paultag
Copy link
Contributor Author

paultag commented May 17, 2024

@NyxCode Thank you! What a fast review and merge; and thank you very much for further fixing the general case! I really appreciate your work deeply!

@paultag paultag deleted the paultag/qualify-name branch May 17, 2024 19:51
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.

None yet

2 participants