Support for generic types in assertMatchesTypeStructure?
eryi opened this issue · comments
ET commented
Is it possible to get TypeStructure for for generic types?
Fred Emmott commented
If the types are resolved in the alias, it will work fine; do you mean something like this instead?
<?hh
class Foo<T> {
type X = Vector<T>;
}
TypeAssert::assertMatchesTypeStructure(
type_structure(Foo:class, 'X'), // what's T?
$some_value,
);
I don't think this is supported by HHVM, but if it's what you're looking for, I can ask.
Fred Emmott commented
Closing, unclear what's wanted.