I have the following code:

function factorial(n)
  function fact_iter(product, counter, max_count)
    if counter > max_count
      product
    else
      fact_iter(product * counter, counter + one(counter), max_count)
    end
  end

  fact_iter(one(n),one(n),n)
end

By `@code_warntype factorial(10)`, it is "end::Any", which means type 
instable.

However, if I move the definition of `fact_iter` outside, it will get 
"end::Int64", which means type stable.

Reply via email to