about summary refs log tree commit diff stats
path: root/054static_dispatch.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-05-24 19:14:01 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-05-24 19:14:01 -0700
commite38b7a998955dac52d53ac20eead3854974efdf2 (patch)
treeaf72b95cf86a56a46ab8bc31788663612a92d70d /054static_dispatch.cc
parentc43b455d24c9a9418b05245b4917b608793701a9 (diff)
downloadmu-e38b7a998955dac52d53ac20eead3854974efdf2.tar.gz
3003
Bugfix: overriding a primitive recipe with a generic variant that takes
an address of something shouldn't mask the primitive when you call it
with literal 0.
Diffstat (limited to '054static_dispatch.cc')
-rw-r--r--054static_dispatch.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/054static_dispatch.cc b/054static_dispatch.cc
index fa0c6c74..106c757a 100644
--- a/054static_dispatch.cc
+++ b/054static_dispatch.cc
@@ -277,7 +277,7 @@ bool types_strictly_match_except_literal_zero_against_address(const reagent& to,
   // to sidestep type-checking, use /unsafe in the source.
   // this will be highlighted in red inside vim. just for setting up some tests.
   if (is_literal(from) && is_mu_address(to))
-    return from.name == "0";
+    return from.name == "0" && !contains_type_ingredient_name(to);
   return types_strictly_match(to, from);
 }
 
@@ -317,7 +317,7 @@ bool types_strictly_match_except_literal_against_address_or_boolean(const reagen
       && to.type && to.type->value == get(Type_ordinal, "boolean"))
     return boolean_matches_literal(to, from);
   if (is_literal(from) && is_mu_address(to))
-    return from.name == "0";
+    return from.name == "0" && !contains_type_ingredient_name(to);
   return types_strictly_match(to, from);
 }