Skip to content

ban type parameters for macros #2976

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

Merged
merged 1 commit into from
Apr 4, 2023
Merged

ban type parameters for macros #2976

merged 1 commit into from
Apr 4, 2023

Conversation

jakemac53
Copy link
Contributor

@jakemac53 jakemac53 commented Apr 3, 2023

This came up in #1930.

I also removed the changelog section for now, it hasn't been updated consistently and has only one very old entry. Will bring it back once the proposal moves to accepted.

@jakemac53 jakemac53 requested a review from munificent April 3, 2023 16:41
@rrousselGit
Copy link

It's a bit tangential to generic parameters but does this limitation imply that macros' annotated element cannot contain generated types?

Like:

@myMacro
int fn(ClassGeneratedByMyMacro param) => 0;

@jakemac53
Copy link
Contributor Author

jakemac53 commented Apr 4, 2023

It's a bit tangential to generic parameters but does this limitation imply that macros' annotated element cannot contain generated types?

No it does not. The restriction applies only to macro constructor arguments (for which Type is not an allowed parameter type). Type arguments are no different than normal arguments, but this makes it explicit.

The staged approach makes possible the above example.

@jakemac53 jakemac53 merged commit 099db02 into master Apr 4, 2023
@jakemac53 jakemac53 deleted the macro-type-parameters branch April 4, 2023 18:47
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