Skip to content

Callsite @constprop support #48570

@aviatesk

Description

@aviatesk

Like the statement @[no]inline support, we can add support for callsite @constprop annotation. That should allow us to something like:

julia> @noinline f_constprop_simple(f, x) = (f(x); Val{x}())
f_constprop_simple (generic function with 1 method)

julia> @test Base.return_types((Function,)) do f
           Base.@constprop :aggressive f_constprop_simple(f, 1)
       end |> only == Val{1}

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureIndicates new feature / enhancement requests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions