Inspectopedia Help

Incorrect type argument variance

Reports type arguments used in an inheritance statement (a superclass clause, self-type, or an inclusion call) which have incorrect variances. Type arguments passed to an inheritance statement must match in variance with the declaring type variable.


module Enumerable[unchecked out A] end class Example[in A] # Contravariant type variable 'A' of class 'Example' used as a covariant argument include Enumerable[A] end

Inspection Details

By default bundled with:

Qodana for Ruby 2024.1, RubyMine 2024.1,

Can be installed with plugin:

Ruby, 241.SNAPSHOT

Last modified: 29 April 2024