about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--021check_instruction.cc9
-rw-r--r--056recipe_header.cc6
-rw-r--r--061recipe.cc12
3 files changed, 18 insertions, 9 deletions
diff --git a/021check_instruction.cc b/021check_instruction.cc
index f65dd398..bf139ea8 100644
--- a/021check_instruction.cc
+++ b/021check_instruction.cc
@@ -88,12 +88,21 @@ recipe main [
 +mem: storing 1 in location 2
 $error: 0
 
+:(scenario write_number_to_boolean_allowed)
+recipe main [
+  1:number <- copy 34
+  2:boolean <- copy 1:number
+]
++mem: storing 34 in location 2
+$error: 0
+
 :(code)
 // types_match with some leniency
 bool types_coercible(const reagent& to, const reagent& from) {
   if (types_match(to, from)) return true;
   if (is_mu_address(from) && is_mu_number(to)) return true;
   if (is_mu_boolean(from) && is_mu_number(to)) return true;
+  if (is_mu_number(from) && is_mu_boolean(to)) return true;
   // End types_coercible Special-cases
   return false;
 }
diff --git a/056recipe_header.cc b/056recipe_header.cc
index 0974e490..8848bb9b 100644
--- a/056recipe_header.cc
+++ b/056recipe_header.cc
@@ -185,7 +185,7 @@ case NEXT_INGREDIENT_WITHOUT_TYPECHECKING: {
 recipe main [
   1:number <- foo 34
 ]
-recipe foo x:boolean -> y:number [
+recipe foo x:point -> y:number [
   local-scope
   load-ingredients
   reply 35
@@ -195,14 +195,14 @@ recipe foo x:boolean -> y:number [
 :(scenario show_clear_error_on_bad_call_2)
 % Hide_errors = true;
 recipe main [
-  1:boolean <- foo 34
+  1:point <- foo 34
 ]
 recipe foo x:number -> y:number [
   local-scope
   load-ingredients
   reply x
 ]
-+error: main: product 0 has the wrong type at '1:boolean <- foo 34'
++error: main: product 0 has the wrong type at '1:point <- foo 34'
 
 :(after "Transform.push_back(check_instruction)")
 Transform.push_back(check_calls_against_header);  // idempotent
diff --git a/061recipe.cc b/061recipe.cc
index 39778426..c47cef72 100644
--- a/061recipe.cc
+++ b/061recipe.cc
@@ -78,7 +78,7 @@ case CALL: {
 recipe main [
   1:number <- call f, 34
 ]
-recipe f x:boolean -> y:boolean [
+recipe f x:point -> y:point [
   local-scope
   load-ingredients
   y <- copy x
@@ -89,16 +89,16 @@ recipe f x:boolean -> y:boolean [
 :(scenario call_check_variable_recipe)
 % Hide_errors = true;
 recipe main [
-  {1: (recipe boolean -> boolean)} <- copy f
-  2:number <- call {1: (recipe boolean -> boolean)}, 34
+  {1: (recipe point -> point)} <- copy f
+  2:number <- call {1: (recipe point -> point)}, 34
 ]
-recipe f x:boolean -> y:boolean [
+recipe f x:point -> y:point [
   local-scope
   load-ingredients
   y <- copy x
 ]
-+error: main: ingredient 0 has the wrong type at '2:number <- call {1: (recipe boolean -> boolean)}, 34'
-+error: main: product 0 has the wrong type at '2:number <- call {1: (recipe boolean -> boolean)}, 34'
++error: main: ingredient 0 has the wrong type at '2:number <- call {1: (recipe point -> point)}, 34'
++error: main: product 0 has the wrong type at '2:number <- call {1: (recipe point -> point)}, 34'
 
 :(after "Transform.push_back(check_instruction)")
 Transform.push_back(check_indirect_calls_against_header);  // idempotent