Make the type checker return a tree with type annotations.

This is a follow-up of 45ee6cdbf034c1b17716202dda65e1c393985af7. For type
inference, return an expression with type annotated.