Skip to content

Breaking on type constructors with parameters #525

@KristofferC

Description

@KristofferC

After #524 it is possible to set breakpoint on type constructors but this fail when a type constructor is called with specific parameters:

julia> struct Constructor{T}
           x::T
       end

julia> breakpoint(Constructor)
Constructor

julia> @interpret Constructor{Int}(2) # no breakpoint
Constructor{Int64}(2)

julia> @interpret Constructor(2) # works
(Frame for Constructor(x::T) where T in Main at REPL[2]:2
b 1 2  1%1 = Core.apply_type($(QuoteNode(Constructor)), $(Expr(:static_parameter, 1)))
  2 2%2 = (%1)(x)
  3 2  └──      return %2
x = 2
T = Int64
var = T
body = Constructor{T}, breakpoint(Constructor(x::T) where T in Main at REPL[2]:2, line 2))

Presumably, one wants to also break on Constructor{Int} when one adds a breakpoint to Constructor.

Metadata

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