The current implementation does not verify the type constraint, meaning that any type that happens to be of the same C++ type would pass the verifier.
E.g. a TypeAttrOf<I64> would happily accept a i32 since both satisfy isa<IntegerType>().
This patch fixes that by adding an optional type predicate parameter to TypeAttrBase that the type within TypeAttr has to satisfy. TypeAttrOf then simply passes the predicate of its type parameter as argument.