Adding type annotations to a large existing codebase can be challenging, and there are two main approaches: tracing execution of the code to find out what the actual types are at run-time, and static analysis to infer types from a set of initial annotations.
The training data and task architecture limit the types that can be predicted to concrete types. Handling named types would be a more complex task.
Alternatively, such type inference could be used to improve interactive development tools, for example by ordering autocomplete suggestions according to their predicted type. This would require some additional work to allow the system to deal with incomplete source code.