Element type inference in comprehensions acts differently when commands are typed in the REPL or loaded from a file.
Using a single command:
v = [ i::Int | i = 1 : 10 ]
When typed directly everything's ok:
julia> v = [ i::Int | i = 1 : 10 ]
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
When put into a file and loaded:
julia> load("compr_tst.jl")
julia> v
{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
julia> typeof(v)
Array{Any,1}
(the same happens when calling julia compr_tst.jl at the command line).
Element type inference in comprehensions acts differently when commands are typed in the REPL or loaded from a file.
Using a single command:
When typed directly everything's ok:
When put into a file and loaded:
(the same happens when calling
julia compr_tst.jlat the command line).