Runtime type checking using parameterized types

It would be unsafe to check parameterized generics without specific knowledge. Even in some cases with specific knowledge, you have to be careful to construct checks so that they only work on the exact class being checked and no subclasses, see discussion about the unsafety of TypeIs here: Problems with TypeIs - #46 by mikeshardmind, more complex libraries avoid this by parsing into a structured type rather than checking if a type looks like another type.

1 Like