What does contravariance mean?
Contravariance means (object-oriented programming) The reversal of the order of data types acted upon by an operator..
Checking saved dictionary data and trusted language sources. This will stop automatically if a source does not respond.
Pronunciation varies by accent · noun
(object-oriented programming) The reversal of the order of data types acted upon by an operator..
I get why with covariance I can return a Dog (a Dog is a Mammal), but why does contravariance work the other way? Shouldn't it accept a derived type when it expects a base type? Contravariance is consistent with Postel's Law: […]
Use contravariance when its meaning, tone and grammar fit the full sentence. A synonym is not always a direct replacement.
Contravariance means (object-oriented programming) The reversal of the order of data types acted upon by an operator..
The closest synonym depends on the sentence and intended sense.
The opposite depends on the specific sense.
I get why with covariance I can return a Dog (a Dog is a Mammal), but why does contravariance work the other way? Shouldn't it accept a derived type when it expects a base type? Contravariance is consistent with Postel's Law: […]
FreeDictionaryAPI.com / Wiktionary · Original source · CC BY-SA 4.0
Dictionary data is provided by FreeDictionaryAPI.com and sourced from Wiktionary under its stated license.