Skip to content

Commit

Permalink
Clarify how mapping constructor infers a type
Browse files Browse the repository at this point in the history
Fixes #54.
  • Loading branch information
jclark committed Apr 17, 2019
1 parent b253ba6 commit 0d4003e
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lang/spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -2631,9 +2631,18 @@ <h3>Mapping constructor</h3>
that has a default value.
</p>
<p>
If there is no contextually expected type, the inherent type is inferred from
the field names and the static types of the expressions occurring in the mapping
constructor.
If there is no contextually expected type, the type descriptor for the inherent
type will be inferred from the field names and the static types of the
expressions occurring in the mapping constructor. The inferred type will have
field-descriptor for each literal-field-name occurring in the constructor; each
field-descriptor will be required, and the static type will the broad type of
the value-expr for the field; the type will be open to
<code>anydata|error</code>, just as if it had been specified using <code>record
{ <var>field-descriptors</var> }</code>.
</p>
<p>
A value-expr will not have a contextually expected type if its
mapping-constructor-expr does not have a contextually expected type.
</p>
<h3>[Preview] Table constructor</h3>

Expand Down

0 comments on commit 0d4003e

Please sign in to comment.