You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 1, 2023. It is now read-only.
expected output: C<string, A<int>>
actual output: C
The text was updated successfully, but these errors were encountered:
fredemmott
changed the title
TypeSpec\of() doesn't take reified generics into account.
TypeSpec\of() doesn't take inner generics of arbitrary classes into account.
Dec 1, 2020
fredemmott
changed the title
TypeSpec\of() doesn't take inner generics of arbitrary classes into account.
TypeSpec\of() doesn't take inner reified generics of arbitrary classes into account.
Sep 13, 2021
Sorry, I don't think HHVM exposes a Hack API (function) to dynamically query the reified type arguments of a value.
The names of the generic arguments to the type C<string, A<int>> are accessible via the TypeStructure. (The API TypeAssert uses to "reflect" over reified generics.) But if there is no dynamic way to check the inner types, the ->toString() call would be the only place where the generics have any effect. This might create false expectations that the inner types are checked by ->assertType().
If you or anyone else knows a Hack function one could use to access the ints from new C<int, int>(), this might be a good idea to implement. Without this, I am not so sure if ->toString() should promise more than ->assertType() delivers.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
example:
expected output:
C<string, A<int>>
actual output:
C
The text was updated successfully, but these errors were encountered: