<htmlxmlns="http://www.w3.org/1999/xhtml"><head><title>AssignmentRule (infer.Nullsafe.AssignmentRule)</title><linkrel="stylesheet"href="../../../odoc.css"/><metacharset="utf-8"/><metaname="generator"content="odoc 1.5.2"/><metaname="viewport"content="width=device-width,initial-scale=1.0"/><scriptsrc="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><divclass="content"><header><nav><ahref="../index.html">Up</a>–<ahref="../../index.html">infer</a>»<ahref="../index.html">Nullsafe</a>» AssignmentRule</nav><h1>Module <code>Nullsafe.AssignmentRule</code></h1></header><aside><p>Assignment rule should be checked when a value is assigned to a location. Assignment can be explicit (lhs = rhs) or implicit (e.g. returning from a function). This rule checks if null can be passed to a place that does not expect null.</p></aside><dl><dtclass="spec type"id="type-violation"><ahref="#type-violation"class="anchor"></a><code><spanclass="keyword">type</span> violation</code></dt></dl><div><divclass="spec include"><divclass="doc"><dl><dtclass="spec value"id="val-compare_violation"><ahref="#val-compare_violation"class="anchor"></a><code><spanclass="keyword">val</span> compare_violation : <ahref="index.html#type-violation">violation</a><span>-></span><ahref="index.html#type-violation">violation</a><span>-></span> int</code></dt></dl></div></div></div><dl><dtclass="spec value"id="val-check"><ahref="#val-check"class="anchor"></a><code><spanclass="keyword">val</span> check : <span>lhs:<ahref="../AnnotatedNullability/index.html#type-t">AnnotatedNullability.t</a></span><span>-></span><span>rhs:<ahref="../InferredNullability/index.html#type-t">InferredNullability.t</a></span><span>-></span><span><span>(unit,<ahref="index.html#type-violation">violation</a>)</span><ahref="../../IStdlib/index.html#module-IStd">IStdlib.IStd</a>.result</span></code></dt><dd><p>If `null` can leak from a "less strict" type to "more strict" type, this is an Assignment Rule violation.</p></dd></dl><dl><dtclass="spec module"id="module-ProvisionalViolation"><ahref="#module-ProvisionalViolation"class="anchor"></a><code><spanclass="keyword">module</span><ahref="ProvisionalViolation/index.html">ProvisionalViolation</a> : <spanclass="keyword">sig</span> ... <spanclass="keyword">end</span></code></dt><dd><p>Violation that will occur if the provisional annotation becomes real <code>@Nullable</code></p></dd></dl><dl><dtclass="spec module"id="module-ReportableViolation"><ahref="#module-ReportableViolation"class="anchor"></a><code><spanclass="keyword">module</span><ahref="ReportableViolation/index.html">ReportableViolation</a> : <spanclass="keyword">sig</span> ... <spanclass="keyword">end</span></code></dt><dd><p>Violation that needs to be reported to the user.</p></dd></dl></div></body></html>