Open huan opened 4 years ago
When we are developing Wechaty with Puppet Providers, we will always face an error of instanceof mismatch, like
instanceof
According to https://stackoverflow.com/a/47116527/1123955, we can define an Interface for our AbstractPuppet class:
interface Puppet extends AbstractPuppet { }
After that, we can always use the Interface of Puppet and never use instanceof again, for a better and a beautiful duck typing world.
A workaround for now: https://github.com/wechaty/wechaty/commit/2e951b7538540a5a94a867ad46ac86721a7c33af
Related to https://github.com/wechaty/wechaty/issues/1930
When we are developing Wechaty with Puppet Providers, we will always face an error of
instanceof
mismatch, likeAccording to https://stackoverflow.com/a/47116527/1123955, we can define an Interface for our AbstractPuppet class:
After that, we can always use the Interface of Puppet and never use
instanceof
again, for a better and a beautiful duck typing world.