Add simple type inference for type checker.