<htmlxmlns="http://www.w3.org/1999/xhtml"><head><title>Nullsafe__AssignmentRule (infer.Nullsafe__AssignmentRule)</title><linkrel="stylesheet"href="../../odoc.css"/><metacharset="utf-8"/><metaname="generator"content="odoc 1.5.1"/><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>» Nullsafe__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="../Nullsafe/AnnotatedNullability/index.html#type-t">Nullsafe.AnnotatedNullability.t</a></span><span>-></span><span>rhs:<ahref="../Nullsafe/InferredNullability/index.html#type-t">Nullsafe.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>