Skip to content

Bypass struct construction in createinstance  #138

@piever

Description

@piever

The default behavior of createinstance(T, args...) does not work if T has only nonstandard inner constructors.

MWE:

struct A
    x::Float64
    y::Float64
    A(x) = new(x, y)
end

By default, we should probably bypass the constructor, like Serialization does, see https://github.com/JuliaLang/julia/blob/e24e2f091ad0f9f30ad85bf448130325a3f5c060/stdlib/Serialization/src/Serialization.jl#L1341-L1372 for an example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions