Ref() which doesn't escape inside a function allocates on the heap

from https://discourse.julialang.org/t/how-to-know-if-object-memory-resides-on-stack-or-heap/4927/8:

And there are cases that’s currently considered escaping but may not in the future,

  • used in function call to non-inlined function
  • stored to argument of non-inlined function

but I really don’t understand this limitation, and am surprised that “the future” isn’t now considering that was from 2017.