about summary refs log tree commit diff stats
path: root/html/021check_instruction.cc.html
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-04-25 22:27:19 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-04-25 22:27:19 -0700
commit32b8fac2799ac7cec613e84a3eb9c009141b6a3a (patch)
tree11f56c1a235abf7b626ea8983fff3d2edb1fcf98 /html/021check_instruction.cc.html
parent224972ee9871fcb06ee285fa5f3d9528c034d414 (diff)
downloadmu-32b8fac2799ac7cec613e84a3eb9c009141b6a3a.tar.gz
2866
Diffstat (limited to 'html/021check_instruction.cc.html')
-rw-r--r--html/021check_instruction.cc.html13
1 files changed, 13 insertions, 0 deletions
diff --git a/html/021check_instruction.cc.html b/html/021check_instruction.cc.html
index 580a32f6..7771ea55 100644
--- a/html/021check_instruction.cc.html
+++ b/html/021check_instruction.cc.html
@@ -191,10 +191,23 @@ $error: <span class="Constant">0</span>
 <span class="Normal">bool</span> types_strictly_match<span class="Delimiter">(</span>type_tree* to<span class="Delimiter">,</span> type_tree* from<span class="Delimiter">)</span> <span class="Delimiter">{</span>
   <span class="Normal">if</span> <span class="Delimiter">(</span>!to<span class="Delimiter">)</span> <span class="Identifier">return</span> <span class="Constant">true</span><span class="Delimiter">;</span>
   <span class="Normal">if</span> <span class="Delimiter">(</span>!from<span class="Delimiter">)</span> <span class="Identifier">return</span> to<span class="Delimiter">-&gt;</span>value == <span class="Constant">0</span><span class="Delimiter">;</span>
+  <span class="Normal">if</span> <span class="Delimiter">(</span>from<span class="Delimiter">-&gt;</span>value == -<span class="Constant">1</span><span class="Delimiter">)</span> <span class="Identifier">return</span> from<span class="Delimiter">-&gt;</span>name == to<span class="Delimiter">-&gt;</span>name<span class="Delimiter">;</span>
   <span class="Normal">if</span> <span class="Delimiter">(</span>to<span class="Delimiter">-&gt;</span>value != from<span class="Delimiter">-&gt;</span>value<span class="Delimiter">)</span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span>
   <span class="Identifier">return</span> types_strictly_match<span class="Delimiter">(</span>to<span class="Delimiter">-&gt;</span>left<span class="Delimiter">,</span> from<span class="Delimiter">-&gt;</span>left<span class="Delimiter">)</span> &amp;&amp; types_strictly_match<span class="Delimiter">(</span>to<span class="Delimiter">-&gt;</span>right<span class="Delimiter">,</span> from<span class="Delimiter">-&gt;</span>right<span class="Delimiter">);</span>
 <span class="Delimiter">}</span>
 
+<span class="Normal">void</span> test_unknown_type_does_not_match_unknown_type<span class="Delimiter">()</span> <span class="Delimiter">{</span>
+  reagent a<span class="Delimiter">(</span><span class="Constant">&quot;a:foo&quot;</span><span class="Delimiter">);</span>
+  reagent b<span class="Delimiter">(</span><span class="Constant">&quot;b:bar&quot;</span><span class="Delimiter">);</span>
+  CHECK<span class="Delimiter">(</span>!types_strictly_match<span class="Delimiter">(</span>a<span class="Delimiter">,</span> b<span class="Delimiter">));</span>
+<span class="Delimiter">}</span>
+
+<span class="Normal">void</span> test_unknown_type_matches_itself<span class="Delimiter">()</span> <span class="Delimiter">{</span>
+  reagent a<span class="Delimiter">(</span><span class="Constant">&quot;a:foo&quot;</span><span class="Delimiter">);</span>
+  reagent b<span class="Delimiter">(</span><span class="Constant">&quot;b:foo&quot;</span><span class="Delimiter">);</span>
+  CHECK<span class="Delimiter">(</span>types_strictly_match<span class="Delimiter">(</span>a<span class="Delimiter">,</span> b<span class="Delimiter">));</span>
+<span class="Delimiter">}</span>
+
 <span class="Normal">bool</span> is_unsafe<span class="Delimiter">(</span><span class="Normal">const</span> reagent&amp; r<span class="Delimiter">)</span> <span class="Delimiter">{</span>
   <span class="Identifier">return</span> has_property<span class="Delimiter">(</span>r<span class="Delimiter">,</span> <span class="Constant">&quot;unsafe&quot;</span><span class="Delimiter">);</span>
 <span class="Delimiter">}</span>