Skip to content
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

Bypass struct construction in createinstance #138

Closed
piever opened this issue Jul 14, 2020 · 0 comments · Fixed by #145
Closed

Bypass struct construction in createinstance #138

piever opened this issue Jul 14, 2020 · 0 comments · Fixed by #145
Milestone

Comments

@piever
Copy link
Collaborator

piever commented Jul 14, 2020

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.

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 a pull request may close this issue.

1 participant