https://kotlinlang.org logo
#announcements
Title
# announcements
t

thymecypher

05/25/2017, 1:30 PM
Correct - and I’m fine with StatusViewProcessor<SmartDevice> since StatusViewProcessor HAS to be T:SmartDevice anyway, but then it says this class isn’t compatible: class BatteryStatusViewProcessor : StatusViewProcessor<Battery>
d

diesieben07

05/25/2017, 1:32 PM
thymecypher: So
class BatteryStatusViewProcessor : StatusViewProcessor<Battery>
does not compile with
Battery
extending
SmartDevice
?
t

thymecypher

05/25/2017, 1:32 PM
Correct, I get Error:(46, 33) Type mismatch: inferred type is BatteryStatusViewProcessor but StatusViewProcessor<SmartDevice>? was expected
And if I’m not mistaken, I was getting the “Update to Kotlin 1.1” dialog - it’s not appearing meaning I probably inadvertently clicked it, and I hadn’t touched this code in a week or so - may that be why?
d

diesieben07

05/25/2017, 1:34 PM
Well, yes, BatteryStatusProcessor is a StatusViewProcessor<Battery>, not a StatusViewProcessor<SmartDevice>
You can say StatusViewProcessor<out SmartDevice> though
t

thymecypher

05/25/2017, 1:35 PM
Yeah, then I’d be stuck checking type inside the class but that might be fine.
Thanks!