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

@nospecialize on argument destructuring #52060

Open
theogf opened this issue Nov 7, 2023 · 0 comments
Open

@nospecialize on argument destructuring #52060

theogf opened this issue Nov 7, 2023 · 0 comments

Comments

@theogf
Copy link

theogf commented Nov 7, 2023

It looks like @nospecialize does not work on argument destructuring:

I want to use @nospecialize on a Pair (or a Tuple, does not matter) and Julia normally allows you to unpack the pair directly in the function definition:

foo((a, b)::Pair) = ...

However, I would like to @nospecialize the Pair and

foo(@nospecialize (a, b)::Pair) = ...

does not seem to be valid syntax, I get:

ERROR: syntax: "(a, b)" is not a valid function argument name around REPL[4]:1

It seems the macro code was not updated when argument destructuring was added?

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

1 participant