Skip to content

Commit

Permalink
Default value for readonly intersection
Browse files Browse the repository at this point in the history
Fixes #544
  • Loading branch information
jclark committed Jun 21, 2023
1 parent 5ba2504 commit adf8c30
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lang/spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -2938,6 +2938,14 @@ <h4>Intersection types</h4>
<code>readonly&amp;T</code>, where <code>T</code> describes the primary aspect
of the shape.
</p>
<p>
When T is either <code>R&amp;readonly</code> or <code>readonly&amp;R</code>,
where R is a record type descriptor, and a field in R has a default value with
closure C, then, if the return type of C belongs to <a
href="#Cloneable">Cloneable</a>, the field in T has a default value with a
closure that applies the <a href="#>ImmutableClone</a> operation to result of
evaluating C; otherwise, the field in T does not have a default value.
</p>
</section>
<section>
Expand Down

0 comments on commit adf8c30

Please sign in to comment.