-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Description
(Julia Version 0.3.4-pre+47)
I should know better than to even be attempting what I was attempting, but perhaps something loud should happen if a user tries to set the .parameters
field of a DataType
object.
julia> type A{T}
a::T
end
julia> A(1)
A{Int64}(1)
julia> A(1.0)
A{Float64}(1.0)
julia> A(1.0f0)
A{Float32}(1.0f0)
julia> A("hello")
A{ASCIIString}("hello")
julia> typeof(A(1)).parameters = (Float64,)
(Float64,)
julia> typeof(A("hello")).parameters = (Int,)
(Int64,)
julia> A(2)
A{Float64}(2) #hm
julia> A("hello")
A{Int64}("hello") #hmm
julia> ans.a
"hello"
DilumAluthge
Metadata
Metadata
Assignees
Labels
No labels