AbstractAlgebra.jl icon indicating copy to clipboard operation
AbstractAlgebra.jl copied to clipboard

Better introspection for `@attr` methods

Open fingolfin opened this issue 5 months ago • 1 comments

It would be nice if there was a way to reach the "inner" function for a method declared with @attr.

So e.g. if we have

@attr Any function bla(x::Int)
   X
   Y
   Z
end

then it would be nice if there was a way to call the code X ; Y; Z in the definition of bla, while bypassing the attribute based caching of the return value.

This is useful so that one can run e.g. @code_warntype on it, or generally invoke it while bypassing the caching logic which @attr inserts around it.

fingolfin avatar Sep 16 '24 22:09 fingolfin