during overload resolution it may lead to caching of a wrong hierarchy, because type of anonymous class with diamonds depends on the surrounding method call
possible optimization: reject caching only for classes with diamonds or only during overload resolution
GitOrigin-RevId: ebdb068fb9052741b8bba2b50e5faefcc541438c