Make the type checker return a tree with type annotations.

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