From e38b7a998955dac52d53ac20eead3854974efdf2 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 24 May 2016 19:14:01 -0700 Subject: 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. --- 054static_dispatch.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '054static_dispatch.cc') 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); } -- cgit 1.4.1-2-gfad0