Generate distinct error when indexing covariant containers
Summary:
D29663090 (https://github.com/facebook/hhvm/commit/
6e901314e9bd74462f45cf59bcb4493e52c5ee59) modified the TAST check on containers with covariant in their keys to be consistent with the treatment in typing, i.e. it is only an error if the indexing expression cannot be types as `arraykey`. Whilst correct, this allows indexing of, for example, a `dict<string,_>` with an `int` which will always fail.
This diff restores the previous behaviour but uses a distinct error code, 4449, CovariantIndexTypeMismatch, which still allows us to discern this case from (castable) type errors.
Reviewed By: hgoldstein
Differential Revision:
D30281788
fbshipit-source-id:
ee0ca2ac34ead6eea9316d27bcfbb1bc5a5955fd