Unannotated object's properties are not treated as invariant when passed as arguments #8218
Labels
bug
Typing: property variance
Typing: soundness
No false negatives (type checker claims that there is no error in the incorrect program)
Flow version: 0.113.0
Expected behavior
Objects' properties should be treated as invariant when passed to a function.
Actual behavior
When passed to a function, a simple unannotated object is incorrectly allowed. It appears that if the object is annotated with a type, flow correctly catches the issue (see flow try for more info)
Interestingly enough, if the property in question is nested another layer, the issue is correctly caught. This is seen in the Flow Try in the commented section.
The text was updated successfully, but these errors were encountered: