Skip to content

Improve inference for interpolated tuple parameters in stagedfunctions #10191

Closed

Description

Would it be possible easy to improve the inference here?

julia> immutable Foo{T} end

julia> stagedfunction bar{T}(x::Foo{T})
         return :(Foo{$T}())
       end
bar (generic function with 1 method)

julia> @code_warntype bar(Foo{(1,2)}())
Variables:
  x::Foo{(1,2)}

Body:
  begin
      return ((top(apply_type))(Foo,(1,2))::Type{_<:Foo{T}})()::Foo{T}
  end::Foo{T}

Cc @Keno. This seems like an extension of #9016 (which makes the inference for the normal function equivalent concrete).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions