Skip to content

Commit

Permalink
Should infer precise-type with read-only field
Browse files Browse the repository at this point in the history
Part of #464.
  • Loading branch information
jclark committed Apr 1, 2020
1 parent 0158e09 commit 5b1f357
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lang/spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -3741,11 +3741,12 @@ <h4>Mapping constructor</h4>
If there is no contextually expected type, then the inherent type will be an
exclusive-record-type-descriptor with an individual-field-descriptor for each
specific-field; the type of each field-descriptor will be the broad type of the
value-expr in the field. The static type of the expression in every spread-field
will also be added to the inherent type. If there are fields specified as a
computed-name-field, then there will also be a record-rest-descriptor
<code>T...</code>, where <code>T</code> is the union of the broad types of the
value-expr in all such fields.
value-expr in the field, unless the field is read-only in which case the type of
the field-descriptor will be the precise type. The static type of the expression
in every spread-field will also be added to the inherent type. If there are
fields specified as a computed-name-field, then there will also be a
record-rest-descriptor <code>T...</code>, where <code>T</code> is the union of
the broad types of the value-expr in all such fields.
</p>
<p>
If a specific-field does not use a string-literal for the name of the field and
Expand Down

0 comments on commit 5b1f357

Please sign in to comment.