The following code addVerticalSlider = @cfunction( $_addVerticalSlider, Cvoid, (Ptr{Cvoid}, Cstring, Ptr{T}, T, T, T, T)) gives ERROR: TypeError: in cfunction method definition, expected Type, got a value of type TypeVar on Julia 1.9. It was working with older version (like 1.6).
I can use real types instead of T , but Ptr{T} works… Why that? How can it be solved ?
Ah, I see - I don’t think you can use @cfunction like that in local scope. The function in question must already exist, and the argument types need to be known. As the docstring mentions, all of this happens during compilation, not runtime:
Note that the argument type tuple must be a literal tuple, and not a tuple-valued variable or expression (although it can include a splat expression). And that these arguments will be evaluated in global scope during compile-time (not deferred until runtime).