Skip to content

InteractiveUtils: Support callable objects as functions in introspection macros #58905

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

serenity4
Copy link
Member

Follow-up to the follow-up #57911, building on the changes to introspection functions to support signature tuples being provided as a single argument.

This enables support for calls of the form

@code_typed (::Returns{Int})(1)
@code_llvm (::Base.Fix2{typeof(+), Float64})(::Int)

by providing an extra use_signature_tuple::Bool = false parameter in gen_call_with_extracted_types. Setting this parameter to true changes the code generation from $fcn(f, Tuple{argtypes...}) to $fcn(Tuple{f, argtypes...}) (where $fcn can be e.g. code_typed, code_llvm etc).

topolarity and others added 7 commits July 3, 2025 13:49
This allows you to call, e.g., `code_typed((Foo, Int, Int))` to query
the code for `(::Foo)(::Int, ::Int)`
This allows you to call, e.g., `code_typed((Foo, Int, Int))` to query
the code for `(::Foo)(::Int, ::Int)`
@serenity4 serenity4 requested a review from topolarity July 4, 2025 14:40
@serenity4 serenity4 changed the title Support callable objects as functions in introspection macros InteractiveUtils: Support callable objects as functions in introspection macros Jul 4, 2025
@serenity4 serenity4 self-assigned this Jul 4, 2025
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.

2 participants