Re:Telegram Login for Websites
by Crespyl on Wednesday February 07, 2018 @03:25PM
(#16327685)
It's essentially just how Java works, and isn't that uncommon in statically typed procedural languages.
The `view` variable is still a reference of the parent type (Say `MessageCell` for now, can't be bothered to find that part in the code), and `MessageCell` references can only do certain things.
It's possible to check what the type of the underlying object is with `instanceof`, but that doesn't change the type of the reference.
If you want to do things that only a `ChatMessageCell` can do, you need to make a new reference of that type.
The `view` variable is still a reference of the parent type (Say `MessageCell` for now, can't be bothered to find that part in the code), and `MessageCell` references can only do certain things.
It's possible to check what the type of the underlying object is with `instanceof`, but that doesn't change the type of the reference.
If you want to do things that only a `ChatMessageCell` can do, you need to make a new reference of that type.