Inspectopedia
 
2024.3

Type parameter can have 'in' or 'out' variance

Info
New
Last modified: 03 December 2024

Reports type parameters that can have in or out variance.

Using in and out variance provides more precise type inference in Kotlin and clearer code semantics.

Example:

The quick-fix adds the matching variance modifier: