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. --- 053recipe_header.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '053recipe_header.cc') diff --git a/053recipe_header.cc b/053recipe_header.cc index 057234f9..e299d3c0 100644 --- a/053recipe_header.cc +++ b/053recipe_header.cc @@ -362,7 +362,7 @@ def add2 x:num, y:num [ def foo -> x:num [ local-scope x:num <- copy 0 - z:bool <- copy 0/false + z:bool <- copy false return-if z, z ] +error: foo: replied with the wrong type at 'return-if z, z' @@ -580,7 +580,7 @@ def add2 x:num, y:num -> z:num [ local-scope load-ingredients z <- add x, y # no type for z - return-if 0/false, 34 + return-if false, 34 ] +mem: storing 8 in location 1 -- cgit 1.4.1-2-gfad0