Total noob question. Is there an equivalent of instanceof in Fantom? I know about type(), but i want to know if the type of an instance can be resolved to any superclass, not just a specific class. Specifically, i want to know if x is a java.util.List, when it's concrete type could be an ArrayList, LinkedList, etc.
Matthew Lohbihler Tue 30 May 2017
Total noob question. Is there an equivalent of instanceof in Fantom? I know about type(), but i want to know if the type of an instance can be resolved to any superclass, not just a specific class. Specifically, i want to know if x is a java.util.List, when it's concrete type could be an ArrayList, LinkedList, etc.
SlimerDude Tue 30 May 2017
Hey Matthew!
Try
is
andisnot
- see Type Checking:There is also
Type.fits()
- see fits:Matthew Lohbihler Tue 30 May 2017
Thanks!