Skip to content

Can I get the real type of Typealias #12

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

Closed
Mx-Iris opened this issue Jan 29, 2024 · 2 comments
Closed

Can I get the real type of Typealias #12

Mx-Iris opened this issue Jan 29, 2024 · 2 comments

Comments

@Mx-Iris
Copy link
Contributor

Mx-Iris commented Jan 29, 2024

I'm using AddAsyncMacro from the example, and it seems to only get the direct function type, if I use Optional or Typealias I get errors

iShot_2024-01-29_21 38 02
@stackotter
Copy link
Owner

Hey, thanks for checking out the toolkit!

Unfortunately macros cannot know what a typealias expands to, so that case could not be handled without passing the macro extra information (as in making the macro take an optional argument where the dev can specify the underlying type of the completion handler).

However, optional completion handlers (without typealiases) could definitely be supported! (because all of the required type information is present in the syntax). The example macros aren’t very comprehensive because they’re only intended to demonstrate usage of the toolkit, but I’d happily accept a PR.

@stackotter
Copy link
Owner

I think my previous comment should answer your question, but feel free to reopen the issue if you have any related concerns

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