Simple cases of, int being a number really.
Im creating a generic class test<T>
and i want to test T to see if its inherited from number (or num in the case of Dart).
Based on the Objects, Object > num > int
in the docs, so at first I was thinking that: T is num
would work if T
is int
. Testing int is num
shows false. There must be another keyword i need to use instead of is
to determine if it is a child of a particular class.
Im trying to set it up such that if T is a child of num it will process comparisons differently than if they were strings.
To me, this goes back to the polymorphism-inheritance design of is-a and has-a relationshis.