From dd66068298b0a11f2a1f195376cba98e0c8570b5 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sun, 17 Jun 2018 00:05:38 -0700 Subject: 4261 - start using literals for 'true' and 'false' They uncovered one bug: in edit/003-shortcuts.mu was returning 0 for an address in one place where I thought it was returning 0 for a boolean. Now we've eliminated this bad interaction between tangling and punning literals. --- 056shape_shifting_recipe.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to '056shape_shifting_recipe.cc') diff --git a/056shape_shifting_recipe.cc b/056shape_shifting_recipe.cc index 29d443c2..f1145803 100644 --- a/056shape_shifting_recipe.cc +++ b/056shape_shifting_recipe.cc @@ -46,7 +46,7 @@ if (Current_routine->calls.front().running_step_index == 0 :(before "End Matching Types For Literal(to)") if (contains_type_ingredient_name(to)) return false; -:(after "Static Dispatch Phase 3") +:(after "Static Dispatch Phase 2") candidates = strictly_matching_shape_shifting_variants(inst, variants); if (!candidates.empty()) { recipe_ordinal exemplar = best_shape_shifting_variant(inst, candidates); @@ -68,10 +68,6 @@ if (contains_key(Recipe, inst.operation) && !is_primitive(inst.operation) return; } -:(replace{} "Match Literal Zero Against Address") -if (is_literal(from) && is_mu_address(to)) - return from.name == "0" && !contains_type_ingredient_name(to); - :(code) // phase 3 of static dispatch vector strictly_matching_shape_shifting_variants(const instruction& inst, const vector& variants) { @@ -1111,7 +1107,7 @@ def foo a:_elem [ ] # tangle some code that refers to the type ingredient after [ - b:bool <- copy 0 # type abbreviation + b:bool <- copy false # type abbreviation ] # trigger specialization def main [ -- cgit 1.4.1-2-gfad0