Skip to content

Commit

Permalink
Allow readonly fields in record type descriptor
Browse files Browse the repository at this point in the history
Fixes #464.
  • Loading branch information
jclark committed May 12, 2020
1 parent 2f77df7 commit d9f2037
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lang/spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -1534,6 +1534,12 @@ <h5>Record types</h5>
optional field.</li>
</ul>
<p>
If an <code>individual-field-descriptor</code> specifies <code>readonly</code>,
then there is also a constraint that the field has its read-only bit set.
Furthermore, the type of the field is the intersection of <code>readonly</code>
and the type specified by the type-descriptor.
</p>
<p>
The order of the <code>individual-field-descriptor</code>s within a
<code>record-type-descriptor</code> is not significant. Note that the delimited
identifier syntax allows the field name to be any non-empty string.
Expand Down Expand Up @@ -1567,6 +1573,12 @@ <h5>Record types</h5>
<em>closed</em>.
</p>
<p>
If a record type descriptor is closed and every individual-type-descriptor
specifies <code>readonly</code>, then it describes a type that is a subtype of
<code>readonly</code>: a shape belongs to the type only if its read-only bit is
set.
</p>
<p>
A <code>default-value</code> specifies a default value for the field, which is
used when the record type descriptor is used to construct a mapping value but no
value is specified explicitly for the field. The type descriptor contains a
Expand Down

0 comments on commit d9f2037

Please sign in to comment.