I am wondering if this is a bug or just an irrational request:
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
but
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
Any idea if it's expected behaviour?
interesting, it's probably jsut that the implementation of @nospecialize
was never updated when we added argument destructuring
I'd open an issue, that's not expected behaviour
Cool thanks I will open one.
https://github.com/JuliaLang/julia/issues/52060
This half reminds me of https://github.com/JuliaLang/julia/issues/49914
Last updated: Nov 06 2024 at 04:40 UTC