hhvm / type-assert

Hack library for converting untyped data to typed data.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for generic types in assertMatchesTypeStructure?

eryi opened this issue · comments

commented

Is it possible to get TypeStructure for for generic types?

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.

Closing, unclear what's wanted.