type O = {
[string]: number
}
interface I {
[string]: number
}
declare var o: O;
(o: I);
Fails with:
10: (o: I);
^ O. This type is incompatible with
10: (o: I);
^ I
Indexable signature is incompatible:
2: [string]: number
^ number. This type is incompatible with
6: [string]: number
^ string
The problem is that structural_subtype and its callers don't manage $key and/or $value when they're present in fields_pmap. That doesn't work with ObjT as it's currently modelled.
Okay code:
Fails with:
The problem is that
structural_subtype
and its callers don't manage$key
and/or$value
when they're present infields_pmap
. That doesn't work with ObjT as it's currently modelled.