Marc Knaup
05/10/2020, 4:48 PMfoo.value
resolve to Any?
and not the upper bound Bar
?thana
05/10/2020, 5:48 PMin
makes the type parameter contravariant. you can safeley write a Bar
to foo
but can't safley read itMarc Knaup
05/10/2020, 6:34 PMBar
, which is the upper bound.turansky
05/10/2020, 10:40 PMMarc Knaup
05/11/2020, 8:31 AMthana
05/11/2020, 8:39 AMT
to be a Bar
but still in Bar
mean "any supertype of Bar"