您是否在某个地方有一个名为的类或接口
T,或者您在某个地方将其
T用作具体的类型名称,而不是用作类型参数(这意味着您可能已经忘记了其他地方(例如在封闭的类中)来指定它
T是类型参数)
)?我可以重现您的问题:
class T { // A concrete type T}interface B<T> { // warning: The type parameter T is hiding the type T}interface A<T> extends B<T> { // warning: The type parameter T is hiding the type T T getObject();}如果我删除class
T,它将消失。



