We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This is from https://groups.google.com/forum/#!topic/julia-users/LIXG4TjUpDI and it might not be a Julia bug.
The issue is in ImmutableArrays.jl where the convert function is able to create a type other than the passed one. Here is a reduced test case:
convert
immutable Vec2{T} x::T y::T end Vec2(a::AbstractVector) = Vec2(ntuple(2,x->a[x])...) import Base.convert convert{T}(::Type{Vec2{T}},x::AbstractVector) = Vec2(x) immutable MyType m::Vec2{Float32} end println(MyType([3.0;4.0]))
This pasted in a REPL prints
MyType(Vec2{Float32}(0.0f0,2.125f0))
Might it be able to detect when MyType is constructed the it got passed a Vec2{Float64}?
MyType
Vec2{Float64}
The text was updated successfully, but these errors were encountered:
Seems it gets checked if MyType is mutable, and not if it is immutable. That seems like a bug.
Sorry, something went wrong.
9de38dc
JeffBezanson
No branches or pull requests
This is from https://groups.google.com/forum/#!topic/julia-users/LIXG4TjUpDI
and it might not be a Julia bug.
The issue is in ImmutableArrays.jl where the
convert
function is able to create a type other than the passed one. Here is a reduced test case:This pasted in a REPL prints
Might it be able to detect when
MyType
is constructed the it got passed aVec2{Float64}
?The text was updated successfully, but these errors were encountered: