Skip to content

Commit

Permalink
Add disjoint requirement for dependent type inference
Browse files Browse the repository at this point in the history
Fixes #386.
  • Loading branch information
jclark committed Mar 15, 2021
1 parent 837f932 commit f35aca7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lang/spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -2007,7 +2007,11 @@ <h4 id="functions">Functions</h4>
type-reference occurring in a return-type-descriptor can refer to a parameter
name if the type of the parameter is a subtype of <code>typedesc</code>. If p is
such a parameter, then a reference to p in the return-type-descriptor denotes
the type that is the value of p. The return-type-descriptor thus denotes a
the type that is the value of p. If the default value for p is
<code>&lt;&gt;</code> and p occurs in the return-type-descriptor in a union p|T,
then for every basic type B, either the intersection of B and T must be empty,
or the intersection of typedesc&lt;B&gt; and the declared type of p must be
empty, or both. The return-type-descriptor thus denotes a
distinct set of shapes for each invocation of the function. A function-signature
with a return-type-descriptor that uses a type-reference to refer to a parameter
name in this way is said to be <em>dependently-typed</em>. Functions with
Expand Down

0 comments on commit f35aca7

Please sign in to comment.