Presumably. Is that not what's happening? It's possible the type inference isn't working here.
The general policy I've been using for typing arguments and return values is Postel's law in a slight reformulation: be conservative in what you return, be liberal in what you accept. In other words, return things with as sharp type information as you can, but accept things with as loose types as you can. For example, if you have a pair of functions, one which produces a Dict and another which accepts a Dict, you probably want to produce a Dict with specific key and value types, rather than just making a Dict{Any,Any} and returning it. The paired function can be more liberal, however, allowing it to be used even if the passed in Dict isn't quite of the expected type.