This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
<!DOCTYPE html>
<htmlxmlns="http://www.w3.org/1999/xhtml"><head><title>PatternMatch (infer.Absint.PatternMatch)</title><linkrel="stylesheet"href="../../../odoc.css"/><metacharset="utf-8"/><metaname="generator"content="odoc 1.5.0"/><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">Absint</a>» PatternMatch</nav><h1>Module <code>Absint.PatternMatch</code></h1></header><aside><p>Module for Pattern matching.</p></aside><dl><dtclass="spec value"id="val-get_this_type_nonstatic_methods_only"><ahref="#val-get_this_type_nonstatic_methods_only"class="anchor"></a><code><spanclass="keyword">val</span> get_this_type_nonstatic_methods_only : <ahref="../../IR/ProcAttributes/index.html#type-t">IR.ProcAttributes.t</a><span>-></span><span><ahref="../../IR/Typ/index.html#type-t">IR.Typ.t</a> option</span></code></dt><dd><p>Get the `this` type of a procedure. Should not be called on non-static methods, otherwise it can return a wrong type</p></dd></dl><dl><dtclass="spec value"id="val-get_type_name"><ahref="#val-get_type_name"class="anchor"></a><code><spanclass="keyword">val</span> get_type_name : <ahref="../../IR/Typ/index.html#type-t">IR.Typ.t</a><span>-></span> string</code></dt><dd><p>Get the name of a type</p></dd></dl><dl><dtclass="spec value"id="val-get_vararg_type_names"><ahref="#val-get_vararg_type_names"class="anchor"></a><code><spanclass="keyword">val</span> get_vararg_type_names : <ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span><ahref="../../IR/Procdesc/Node/index.html#type-t">IR.Procdesc.Node.t</a><span>-></span><ahref="../../IR/Pvar/index.html#type-t">IR.Pvar.t</a><span>-></span><span>string list</span></code></dt><dd><p>Get the type names of a variable argument</p></dd></dl><dl><dtclass="spec value"id="val-method_is_initializer"><ahref="#val-method_is_initializer"class="anchor"></a><code><spanclass="keyword">val</span> method_is_initializer : <ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span><ahref="../../IR/ProcAttributes/index.html#type-t">IR.ProcAttributes.t</a><span>-></span> bool</code></dt><dd><p>Check if the method is one of the known initializer methods.</p></dd></dl><dl><dtclass="spec value"id="val-is_subtype"><ahref="#val-is_subtype"class="anchor"></a><code><spanclass="keyword">val</span> is_subtype : <ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span><ahref="../../IR/Typ/Name/index.html#type-t">IR.Typ.Name.t</a><span>-></span><ahref="../../IR/Typ/Name/index.html#type-t">IR.Typ.Name.t</a><span>-></span> bool</code></dt><dd><p>Is the type a transitive subtype of the typename?</p></dd></dl><dl><dtclass="spec value"id="val-is_subtype_of_str"><ahref="#val-is_subtype_of_str"class="anchor"></a><code><spanclass="keyword">val</span> is_subtype_of_str : <ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span><ahref="../../IR/Typ/Name/index.html#type-t">IR.Typ.Name.t</a><span>-></span> string <span>-></span> bool</code></dt><dd><p>Resolve <code>typ_str</code> in <code>tenv</code>, then check <code>typ</code><: <code>typ_str</code></p></dd></dl><dl><dtclass="spec value"id="val-implements"><ahref="#val-implements"class="anchor"></a><code><spanclass="keyword">val</span> implements : string <span>-></span><ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span> string <span>-></span> bool</code></dt><dd><p>Check whether class implements a given class</p></dd></dl><dl><dtclass="spec value"id="val-implements_arrays"><ahref="#val-implements_arrays"class="anchor"></a><code><spanclass="keyword">val</span> implements_arrays : <ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span> string <span>-></span> bool</code></dt><dd><p>Check whether class implements Java's Arrays</p></dd></dl><dl><dtclass="spec value"id="val-implements_iterator"><ahref="#val-implements_iterator"class="anchor"></a><code><spanclass="keyword">val</span> implements_iterator : <ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span> string <span>-></span> bool</code></dt><dd><p>Check whether class implements Java's Iterator</p></dd></dl><dl><dtclass="spec value"id="val-implements_collection"><ahref="#val-implements_collection"class="anchor"></a><code><spanclass="keyword">val</span> implements_collection : <ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span> string <span>-></span> bool</code></dt><dd><p>Check whether class implements a Java's Collection</p></dd></dl><dl><dtclass="spec value"id="val-implements_collections"><ahref="#val-implements_collections"class="anchor"></a><code><spanclass="keyword">val</span> implements_collections : <ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span> string <span>-></span> bool</code></dt><dd><p>Check whether class implements a Java's Collections</p></dd></dl><dl><dtclass="spec value"id="val-implements_pseudo_collection"><ahref="#val-implements_pseudo_collection"class="anchor"></a><code><spanclass="keyword">val</span> implements_pseudo_collection : <ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span> string <span>-></span> bool</code></dt><dd><p>Check whether class implements a pseudo Collection with support for get() and size() methods</p></dd></dl><dl><dtclass="spec value"id="val-implements_enumeration"><ahref="#val-implements_enumeration"class="anchor"></a><code><spanclass="keyword">val</span> implements_enumeration : <ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span> string <span>-></span> bool</code></dt><dd><p>Check whether class implements a Java's Enumeration</p></dd></dl><dl><dtclass="spec value"id="val-implements_jackson"><ahref="#val-implements_jackson"class="anchor"></a><code><spanclass="keyword">val</span> implements_jackson : string <span>-></span><ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span> string <span>-></span> bool</code></dt><dd><p>Check whether class implements a class from Jackson</p></dd></dl><dl><dtclass="spec value"id="val-implements_org_json"><ahref="#val-implements_org_json"class="anchor"></a><code><spanclass="keyword">val</span> implements_org_json : string <span>-></span><ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span> string <span>-></span> bool</code></dt><dd><p>Check whether class implements a class from Json</p></dd></dl><dl><dtclass="spec value"id="val-implements_inject"><ahref="#val-implements_inject"class="anchor"></a><code><spanclass="keyword">val</span> implements_inject : string <span>-></span><ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span> string <span>-></span> bool</code></dt><dd><p>Check whether class implements a Javax Inject</p></dd></dl><dl><dtclass="spec value"id="val-implements_io"><ahref="#val-implements_io"class="anchor"></a><code><spanclass="keyword">val</span> implements_io : string <span>-></span><ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span> string <span>-></span> bool</code></dt><dd><p>Check whether class implements a Java IO</p></dd></dl><dl><dtclass="spec value"id="val-implements_nio"><ahref="#val-implements_nio"class="anchor"></a><code><spanclass="keyword">val</span> implements_nio : string <span>-></span><ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span> string <span>-></span> bool</code></dt><dd><p>Check whether class implements a Java nio</p></dd></dl><dl><dtclass="spec value"id="val-implements_map"><ahref="#val-implements_map"class="anchor"></a><code><spanclass="keyword">val</span> implements_map : <ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span> string <span>-></span> bool</code></dt><dd><p>Check whether class implements a Java's Map</p></dd></dl><dl><dtclass="spec value"id="val-implements_androidx_map"><ahref="#val-implements_androidx_map"class="anchor"></a><code><spanclass="keyword">val</span> implements_androidx_map : <ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span> string <span>-></span> bool</code></dt><dd><p>Check whether class implements a AndroidX's Map</p></dd></dl><dl><dtclass="spec value"id="val-implements_set"><ahref="#val-implements_set"class="anchor"></a><code><spanclass="keyword">val</span> implements_set : <ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span> string <span>-></span> bool</code></dt><dd><p>Check whether class implements a Java's Set</p></dd></dl><dl><dtclass="spec value"id="val-implements_map_entry"><ahref="#val-implements_map_entry"class="anchor"></a><code><spanclass="keyword">val</span> implements_map_entry : <ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span> string <span>-></span> bool</code></dt><dd><p>Check whether class implements a Java's Map$Entry</p></dd></dl><dl><dtclass="spec value"id="val-implements_queue"><ahref="#val-implements_queue"class="anchor"></a><code><spanclass="keyword">val</span> implements_queue : <ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span> string <span>-></span> bool</code></dt><dd><p>Check whether class implements a Java's Queue</p></dd></dl><dl><dtclass="spec value"id="val-implements_lang"><ahref="#val-implements_lang"class="anchor"></a><code><spanclass="keyword">val</span> implements_lang : string <span>-></span><ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span> string <span>-></span> bool</code></dt><dd><p>Check whether class implements a Java's lang</p></dd></dl><dl><dtclass="spec value"id="val-implements_list"><ahref="#val-implements_list"class="anchor"></a><code><spanclass="keyword">val</span> implements_list : <ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span> string <span>-></span> bool</code></dt><dd><p>Check whether class implements a Java's list</p></dd></dl><dl><dtclass="spec value"id="val-implements_google"><ahref="#val-implements_google"class="anchor"></a><code><spanclass="keyword">val</span> implements_google : string <span>-></span><ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span> string <span>-></span> bool</code></dt><dd><p>Check whether class implements a class of Google</p></dd></dl><dl><dtclass="spec value"id="val-implements_android"><ahref="#val-implements_android"class="anchor"></a><code><spanclass="keyword">val</span> implements_android : string <span>-></span><ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span> string <span>-></span> bool</code></dt><dd><p>Check whether class implements a class of Android</p></dd></dl><dl><dtclass="spec value"id="val-implements_infer_annotation"><ahref="#val-implements_infer_annotation"class="anchor"></a><code><spanclass="keyword">val</span> implements_infer_annotation : string <span>-></span><ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span> string <span>-></span> bool</code></dt><dd><p>Check whether class implements a class of Infer annotation</p></dd></dl><dl><dtclass="spec value"id="val-implements_xmob_utils"><ahref="#val-implements_xmob_utils"class="anchor"></a><code><spanclass="keyword">val</span> implements_xmob_utils : string <span>-></span><ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span> string <span>-></span> bool</code></dt><dd><p>Check whether class implements a class of xmod.utils</p></dd></dl><dl><dtclass="spec value"id="val-supertype_exists"><ahref="#val-supertype_exists"class="anchor"></a><code><spanclass="keyword">val</span> supertype_exists : <ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span><span>(<ahref="../../IR/Typ/Name/index.html#type-t">IR.Typ.Name.t</a><span>-></span><ahref="../../IR/Struct/index.html#type-t">IR.Struct.t</a><span>-></span> bool)</span><span>-></span><ahref="../../IR/Typ/Name/index.html#type-t">IR.Typ.Name.t</a><span>-></span> bool</code></dt><dd><p>Holds iff the predicate holds on a supertype of the named type, including the type itself</p></dd></dl><dl><dtclass="spec value"id="val-supertype_find_map_opt"><ahref="#val-supertype_find_map_opt"class="anchor"></a><code><spanclass="keyword">val</span> supertype_find_map_opt : <ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span><span>(<ahref="../../IR/Typ/Name/index.html#type-t">IR.Typ.Name.t</a><span>-></span><span><spanclass="type-var">'a</span> option</span>)</span><span>-></span><ahref="../../IR/Typ/Name/index.html#type-t">IR.Typ.Name.t</a><span>-></span><span><spanclass="type-var">'a</span> option</span></code></dt><dd><p>Return the first non-None result found when applying the given function to supertypes of the named type, including the type itself</p></dd></dl><dl><dtclass="spec value"id="val-proc_calls"><ahref="#val-proc_calls"class="anchor"></a><code><spanclass="keyword">val</span> proc_calls : <span>(<ahref="../../IR/Procname/index.html#type-t">IR.Procname.t</a><span>-></span><span><ahref="../../IR/ProcAttributes/index.html#type-t">IR.ProcAttributes.t</a> option</span>)</span><span>-></span><ahref="../../IR/Procdesc/index.html#type-t">IR.Procdesc.t</a><span>-></span><span>(<ahref="../../IR/Procname/index.html#type-t">IR.Procname.t</a><span>-></span><ahref="../../IR/ProcAttributes/index.html#type-t">IR.ProcAttributes.t</a><span>-></span> bool)</span><span>-></span><span><span>(<ahref="../../IR/Procname/index.html#type-t">IR.Procname.t</a> * <ahref="../../IR/ProcAttributes/index.html#type-t">IR.ProcAttributes.t</a>)</span> list</span></code></dt><dd><p>Return the callees that satisfy <code>filter</code>.</p></dd></dl><dl><dtclass="spec value"id="val-override_exists"><ahref="#val-override_exists"class="anchor"></a><code><spanclass="keyword">val</span> override_exists : <span>?⁠check_current_type:bool</span><span>-></span><span>(<ahref="../../IR/Procname/index.html#type-t">IR.Procname.t</a><span>-></span> bool)</span><span>-></span><ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span><ahref="../../IR/Procname/index.html#type-t">IR.Procname.t</a><span>-></span> bool</code></dt><dd><p>Return true if applying the given predicate to an override of <code>procname</code> (including <code>procname</code> itself when <code>check_current_type</code> is true, which it is by default) returns true.</p></dd></dl><dl><dtclass="spec value"id="val-override_iter"><ahref="#val-override_iter"class="anchor"></a><code><spanclass="keyword">val</span> override_iter : <span>(<ahref="../../IR/Procname/index.html#type-t">IR.Procname.t</a><span>-></span> unit)</span><span>-></span><ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span><ahref="../../IR/Procname/index.html#type-t">IR.Procname.t</a><span>-></span> unit</code></dt><dd><p>Apply the given predicate to procname and each override of <code>procname</code>. For the moment, this only works for Java</p></dd></dl><dl><dtclass="spec value"id="val-lookup_attributes"><ahref="#val-lookup_attributes"class="anchor"></a><code><spanclass="keyword">val</span> lookup_attributes : <ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span><ahref="../../IR/Procname/index.html#type-t">IR.Procname.t</a><span>-></span><span><ahref="../../IR/ProcAttributes/index.html#type-t">IR.ProcAttributes.t</a> option</span></code></dt><dtclass="spec value"id="val-type_name_get_annotation"><ahref="#val-type_name_get_annotation"class="anchor"></a><code><spanclass="keyword">val</span> type_name_get_annotation : <ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span><ahref="../../IR/Typ/index.html#type-name">IR.Typ.name</a><span>-></span><span><ahref="../../IR/Annot/Item/index.html#type-t">IR.Annot.Item.t</a> option</span></code></dt><dtclass="spec value"id="val-type_get_annotation"><ahref="#val-type_get_annotation"class="anchor"></a><code><spanclass="keyword">val</span> type_get_annotation : <ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span><ahref="../../IR/Typ/index.html#type-t">IR.Typ.t</a><span>-></span><span><ahref="../../IR/Annot/Item/index.html#type-t">IR.Annot.Item.t</a> option</span></code></dt><dtclass="spec value"id="val-type_get_class_name"><ahref="#val-type_get_class_name"class="anchor"></a><code><spanclass="keyword">val</span> type_get_class_name : <ahref="../../IR/Typ/index.html#type-t">IR.Typ.t</a><span>-></span><span><ahref="../../IR/Typ/Name/index.html#type-t">IR.Typ.Name.t</a> option</span></code></dt><dd><p>Get the class name of the type</p></dd></dl><dl><dtclass="spec value"id="val-type_is_class"><ahref="#val-type_is_class"class="anchor"></a><code><spanclass="keyword">val</span> type_is_class : <ahref="../../IR/Typ/index.html#type-t">IR.Typ.t</a><span>-></span> bool</code></dt><dd><p>Is the type a class type</p></dd></dl><dl><dtclass="spec value"id="val-get_fields_nullified"><ahref="#val-get_fields_nullified"class="anchor"></a><code><spanclass="keyword">val</span> get_fields_nullified : <ahref="../../IR/Procdesc/index.html#type-t">IR.Procdesc.t</a><span>-></span><ahref="../../IR__Fieldname/index.html#module-Set">IR.Fieldname.Set</a>.t</code></dt><dd><p>return the set of instance fields that are assigned to a null literal in <code>procdesc</code></p></dd></dl><dl><dtclass="spec value"id="val-is_throwable"><ahref="#val-is_throwable"class="anchor"></a><code><spanclass="keyword">val</span> is_throwable : <ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span><ahref="../../IR/Typ/Name/index.html#type-t">IR.Typ.Name.t</a><span>-></span> bool</code></dt><dd><p><code>is_throwable tenv class_name</code> checks if class_name is of type java.lang.Throwable</p></dd></dl><dl><dtclass="spec value"id="val-is_java_enum"><ahref="#val-is_java_enum"class="anchor"></a><code><spanclass="keyword">val</span> is_java_enum : <ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span><ahref="../../IR/Typ/Name/index.html#type-t">IR.Typ.Name.t</a><span>-></span> bool</code></dt><dd><p>Checks if the type is Java enum (extends java.lang.Enum)</p></dd></dl><dl><dtclass="spec value"id="val-check_class_attributes"><ahref="#val-check_class_attributes"class="anchor"></a><code><spanclass="keyword">val</span> check_class_attributes : <span>(<ahref="../../IR/Annot/Item/index.html#type-t">IR.Annot.Item.t</a><span>-></span> bool)</span><span>-></span><ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span><ahref="../../IR/Procname/index.html#type-t">IR.Procname.t</a><span>-></span> bool</code></dt><dd><p>tests whether any class attributes (e.g., <code>@ThreadSafe</code>) pass check of first argument, including supertypes</p></dd></dl><dl><dtclass="spec value"id="val-check_current_class_attributes"><ahref="#val-check_current_class_attributes"class="anchor"></a><code><spanclass="keyword">val</span> check_current_class_attributes : <span>(<ahref="../../IR/Annot/Item/index.html#type-t">IR.Annot.Item.t</a><span>-></span> bool)</span><span>-></span><ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span><ahref="../../IR/Procname/index.html#type-t">IR.Procname.t</a><span>-></span> bool</code></dt><dd><p>tests whether any class attributes (e.g., <code>@ThreadSafe</code>) pass check of first argument, for current class only</p></dd></dl><dl><dtclass="spec value"id="val-find_superclasses_with_attributes"><ahref="#val-find_superclasses_with_attributes"class="anchor"></a><code><spanclass="keyword">val</span> find_superclasses_with_attributes : <span>(<ahref="../../IR/Annot/Item/index.html#type-t">IR.Annot.Item.t</a><span>-></span> bool)</span><span>-></span><ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a><span>-></span><ahref="../../IR/Typ/Name/index.html#type-t">IR.Typ.Name.t</a><span>-></span><span><ahref="../../IR/Typ/Name/index.html#type-t">IR.Typ.Name.t</a> list</span></code></dt><dd><p>find superclasss with attributes (e.g., <code>@ThreadSafe</code>), including current class</p></dd></dl><dl><dtclass="spec value"id="val-has_same_signature"><ahref="#val-has_same_signature"class="anchor"></a><code><spanclass="keyword">val</span> has_same_signature : <ahref="../../IR/Procname/index.html#type-t">IR.Procname.t</a><span>-></span><span><span>(<ahref="../../IR/Procname/index.html#type-t">IR.Procname.t</a><span>-></span> bool)</span><ahref="../../IStdlib/index.html#module-IStd">IStdlib.IStd</a>.Staged.t</span></code></dt><dd><p>For a given <code>procname</code> checks if the method has the same method name, number, order and types of parameters.)</p></dd></dl><dl><dtclass="spec value"id="val-is_override_of_java_lang_object_equals"><ahref="#val-is_override_of_java_lang_object_equals"class="anchor"></a><code><spanclass="keyword">val</span> is_override_of_java_lang_object_equals : <ahref="../../IR/Procname/index.html#type-t">IR.Procname.t</a><span>-></span> bool</code></dt><dd><p>Whether the method is an override of `java.lang.Object.equals(Object)` or `java.lang.Object.equals(Object)` itself</p></dd></dl><divclass="spec module"id="module-ObjectiveC"><ahref="#module-ObjectiveC"class="anchor"></a><code><spanclass="keyword">module</span><ahref="ObjectiveC/index.html">ObjectiveC</a> : <spanclass="keyword">sig</span> ... <spanclass="keyword">end</span></code></div></div></body></html>