You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>You can define contracts that have a recursive definition naturally:</p>
430
+
<preclass="js"><code>@ let MyObj = Null or {
431
+
a: Num,
432
+
b: MyObj
433
+
}</code></pre>
434
+
<p>This definition checks that the <code>b</code> property is either a <code>null</code> or an object that satisfies the <code>{a: Num, b: MyObj}</code> contract. Note that this will explore the entire object each time a value crosses the contract boundary so it could be potentially expensive if the object is deeply nested.</p>
0 commit comments