It can be a bit difficult to read the output from code_warntype. A good heuristic is to just look at the variables on the top and the final return type. If these are concrete then you are fine. If not, then you can look at the messy code in between to find where the instability occurs.
For your examples, everything is OK.
