If x in your snippet turns out to be Any that will propagate into simulation. For example, here f1 returns Any (see Body::Any), because the input of g is of type Any:
julia> x::Any = 1.0 # ::Any to be explicit that it can assume any value, it is the default
1.0
julia> g(x) = 2 * x
g (generic function with 1 method)
julia> function f1()
y = x
return g(y)
end
f1 (generic function with 1 method)
julia> @code_warntype f1()
MethodInstance for f1()
from f1() @ Main REPL[17]:1
Arguments
#self#::Core.Const(Main.f1)
Locals
y::Any
Body::Any
1 ─ (y = Main.x)
│ %2 = y::Any
│ %3 = Main.g(%2)::Any
└── return %3
We can make the call to g type stable by asserting that x can be converted to a Float64, with an error being thrown otherwise (now we have Body::Float64):
julia> function f2()
y::Float64 = x
return g(y)
end
f2 (generic function with 1 method)
julia> @code_warntype f2()
MethodInstance for f2()
from f2() @ Main REPL[8]:1
Arguments
#self#::Core.Const(Main.f2)
Locals
y::Float64
@_3::Any
Body::Float64
1 ─ Core.NewvarNode(:(y))
│ %2 = Main.x::Any
│ (@_3 = %2)
│ %4 = @_3::Any
│ %5 = (%4 isa Main.Float64)::Bool
└── goto #3 if not %5
2 ─ goto #4
3 ─ %8 = @_3::Any
│ %9 = Base.convert(Main.Float64, %8)::Any
│ %10 = Main.Float64::Core.Const(Float64)
└── (@_3 = Core.typeassert(%9, %10))
4 ┄ %12 = @_3::Float64
│ (y = %12)
│ %14 = y::Float64
│ %15 = Main.g(%14)::Float64
└── return %15
julia> x = "a"
"a"
julia> f2()
ERROR: MethodError: Cannot `convert` an object of type String to an object of type Float64
Thus, in your case, assuming that fracfile[:,:b] is being returned as a Vector{Any} but it can and should be converted to a Vector{Float64}, you could do:
julia> x = Any[1.0, 2.0]
2-element Vector{Any}:
1.0
2.0
julia> function f2()
y::Vector{Float64} = x
return g(y)
end
f2 (generic function with 2 methods)
julia> @code_warntype f2()
MethodInstance for f2()
from f2() @ Main REPL[26]:1
Arguments
#self#::Core.Const(Main.f2)
Locals
y::Vector{Float64}
@_3::Any
Body::Vector{Float64}
1 ─ Core.NewvarNode(:(y))
│ %2 = Main.x::Any
│ %3 = Core.apply_type(Main.Vector, Main.Float64)::Core.Const(Vector{Float64})
│ (@_3 = %2)
│ %5 = @_3::Any
│ %6 = (%5 isa %3)::Bool
└── goto #3 if not %6
2 ─ goto #4
3 ─ %9 = @_3::Any
│ %10 = Base.convert(%3, %9)::Vector{Float64}
└── (@_3 = Core.typeassert(%10, %3))
4 ┄ %12 = @_3::Vector{Float64}
│ (y = %12)
│ %14 = y::Vector{Float64}
│ %15 = Main.g(%14)::Vector{Float64}
└── return %15
such that the instability of x does not propagate into the call to g.