timholy/Grid.jl — pull request #34 by mbauman (2014-07-15 18:22:55+00:00)
Title: Improve inference for InterpGrid & InterpIrregular

For some reason, Julia isn't statically determining that `ndims(A)` comes directly from `A::Array{T}`. As such, the result of `@code_typed InterpGrid([1.,2.,3.], BCnan, InterpLinear)` was `::InterpGrid{Float64,N,BCnan,InterpLinear}`. Once indexed, it lost all inference and became `::Any`.

The fix is simple: just grab `N` from the signature and use it instead of `ndims(A)`.