They’re not unstable from what I can see. Parameterization doesn’t change functions. In fact, if you check the compiled code, T is definitely computed at compile time, so it’s no different than using a type parameter even in the compiled code.
Thanks. I’m surprised that the first one isn’t type-unstable, since the type of the output depends on the result of a calculation within the function. Perhaps I have a faulty definition of type stability.
If one(T) is type-stable (it probably is for any type you’re using), then by knowing T (which is known because of dispatch, methods auto-specialize in Julia), you know the output type of one(T). Thus you know the output type, and every intermediate type. It’s all strictly typed.