diff options
-rw-r--r-- | 021check_instruction.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/021check_instruction.cc b/021check_instruction.cc index a32c6178..4cf74a0f 100644 --- a/021check_instruction.cc +++ b/021check_instruction.cc @@ -87,6 +87,13 @@ def main [ ] +error: main: can't copy '1:address:num' to '2:char'; types don't match +:(scenario write_number_to_character_allowed) +def main [ + 1:num <- copy 97 + 2:char <- copy 1:num +] +$error: 0 + :(scenario write_boolean_to_number_allowed) def main [ 1:bool <- copy 1/true @@ -109,6 +116,7 @@ bool types_coercible(const reagent& to, const reagent& from) { if (types_match(to, from)) return true; if (is_mu_address(from) && is_real_mu_number(to)) return true; if (is_mu_boolean(from) && is_real_mu_number(to)) return true; + if (is_real_mu_number(from) && is_mu_character(to)) return true; // End types_coercible Special-cases return false; } |