Closed cossio closed 4 years ago
Thanks @cossio. You had me concerned for a moment, but actually this a consequence of working at the REPL. To be type-stable that 1
argument needs to be constant propagated, which it will from code written in functions.
Check this out:
julia> f(a) = splitdims(a, 1)
f (generic function with 1 method)
julia> @code_warntype f([1 2 3; 4 5 6])
Variables
#self#::Core.Compiler.Const(f, false)
a::Array{Int64,2}
Body::Array{Array{Int64,1},1}
1 ─ %1 = Main.splitdims(a, 1)::Array{Array{Int64,1},1}
└── return %1
I see, thanks for taking a look!
No worries!