diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-01-30 22:17:36 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-01-30 22:17:36 -0800 |
commit | 3bfd75fcf0eacdab7e26700fee92327cfbf420a5 (patch) | |
tree | 4df239b46e0cef1ca2ababaec7c794a04cf7d157 /056recipe_header.cc | |
parent | 007382e2a92b743ba50e6bd87d637ff7c559212f (diff) | |
download | mu-3bfd75fcf0eacdab7e26700fee92327cfbf420a5.tar.gz |
2619 - actually allow coercing booleans to numbers
This uncovered a bug where I've been forgetting the directionality of arguments to types_coercible().
Diffstat (limited to '056recipe_header.cc')
-rw-r--r-- | 056recipe_header.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/056recipe_header.cc b/056recipe_header.cc index 130f832e..de6793de 100644 --- a/056recipe_header.cc +++ b/056recipe_header.cc @@ -216,6 +216,7 @@ void check_calls_against_header(const recipe_ordinal r) { const recipe& callee = get(Recipe, inst.operation); if (!callee.has_header) continue; for (long int i = 0; i < min(SIZE(inst.ingredients), SIZE(callee.ingredients)); ++i) { + // ingredients coerced from call to callee if (!types_coercible(callee.ingredients.at(i), inst.ingredients.at(i))) raise_error << maybe(caller.name) << "ingredient " << i << " has the wrong type at '" << inst.to_string() << "'\n" << end(); if (is_unique_address(inst.ingredients.at(i))) @@ -223,7 +224,8 @@ void check_calls_against_header(const recipe_ordinal r) { } for (long int i = 0; i < min(SIZE(inst.products), SIZE(callee.products)); ++i) { if (is_dummy(inst.products.at(i))) continue; - if (!types_coercible(callee.products.at(i), inst.products.at(i))) + // products coerced from callee to call + if (!types_coercible(inst.products.at(i), callee.products.at(i))) raise_error << maybe(caller.name) << "product " << i << " has the wrong type at '" << inst.to_string() << "'\n" << end(); if (is_unique_address(inst.products.at(i))) raise << maybe(caller.name) << "try to avoid getting non-shared addresses out of calls, like product " << i << " at '" << inst.to_string() << "'\n" << end(); |