Inspectopedia Help

Type parameter hides visible type

Reports type parameters that have the same names as the visible types in the current scope. Such parameter names may be confusing.


abstract class MyList<T> extends AbstractList<T> { private List<T> elements; // type parameter 'T' hides type parameter 'T' public <T> T[] toArray(T[] array) { return elements.toArray(array); } }

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3


Java, 233.SNAPSHOT

Last modified: 13 July 2023