Is there a way to specify in generic code that you want the best fit of a const/immutable reference depending on the return type (but not a mutable one)?
I mean, if f() return mutable or const then it should be const, but if it returns immutable then it should be immutable. Something like:
readonly myref = f()