Incorrect type inferred for key lookups from bounded polymorphic types
Description
When a polymorphic type x has an upper bound of U, and U is an HMap or a record, I'd expect key lookups from x have the same type as key lookups from U. Currently they are inferred as Any.
Explicitly upcasting x to U with ann-form fixes the inferred type.
Both HMap and record bounds exhibit the same problem.
When a polymorphic type
x
has an upper bound ofU
, andU
is anHMap
or a record, I'd expect key lookups fromx
have the same type as key lookups fromU
. Currently they are inferred asAny
.Explicitly upcasting
x
toU
withann-form
fixes the inferred type.Both
HMap
and record bounds exhibit the same problem.