caching for type annotations