Abstract
Since its first introduction in an object-oriented programminglanguage, genericity has kept complex relationship with variance, especiallycovariance. For instance, current languages like Java, C , Scala, Eiffel, Dartand Nit, offer different forms of variance, either unsafe (eg array covariance)or safe (definition- or use-site variance). This paper presents an empiricalstudy analyzing the different uses of variance in actual programs, principallyin Java, and secondarily in Nit. This study tries to quantify (i) the usages ofunsafe covariance and its transformation into safe variance; (ii) the usagesof use-site variance, its effective usefulness in a polymorphic type flow, andits possible tranformation into definition-site variance. The results provideconcrete arguments in favor of a modification of the specifications of gener-icity in these object-oriented languages, by reinforcing both the safety andthe flexibility of their type systems.