Why does `foo.value` resolve to `Any?` and not the...
# announcements
m
Why does
foo.value
resolve to
Any?
and not the upper bound
Bar
?
t
in
makes the type parameter contravariant. you can safeley write a
Bar
to
foo
but can't safley read it
m
I know, but even though it’s contravariant it can’t be higher in hierarchy than
Bar
, which is the upper bound.
t
m
Thank you, but I think that’s a different once. Mine is about contravariance, also it also doesn’t work with old inference.
t
i still think it's working as expected. of course you restricted
T
to be a
Bar
but still
in Bar
mean "any supertype of Bar"