Skip to content
This repository has been archived by the owner on Sep 1, 2023. It is now read-only.

Clean up references to varray and darray #61

Open
skishore opened this issue Jul 9, 2021 · 1 comment · May be fixed by #69
Open

Clean up references to varray and darray #61

skishore opened this issue Jul 9, 2021 · 1 comment · May be fixed by #69

Comments

@skishore
Copy link

skishore commented Jul 9, 2021

VarraySpec and DarraySpec are now nearly the same as VecSpec and DictSpec. There are some small differences in the traces that are generated on failure, and there's some redundant logic in the legacy specs (e.g. VarraySpec doesn't trust that a varray's keys are consecutive integers).

Let's get rid of VarraySpec and DarraySpec, and rename VarrayOrDarraySpec to VecOrDictSpec. We should also eliminate any other references to varray or darray in other types, like tuples.

This change will introduce some backwards incompatibility. It looks to me like assertType and coerceType are okay for these specs, but the type name will change, and maybe people are depending on that.

One warning, though: while varray and darray are gone, it is still possible to distinguish varray and vec typehints via reflection... That means that the TypeStructure kinds for varray, darray, and varray_or_darray still exist. It will be some time before we can clean that up, but treating the kinds homogeneously to vec, dict, and vec_or_dict will help us with that.

@lexidor
Copy link
Contributor

lexidor commented Jul 9, 2021

I eliminated the tuple and shape representation checks in #60.
If varray and darray specs will be removed, we need to bump the minimum hhvm version to 4.116, since the typechecker learned that varray and vec are the same type in that version.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants