about summary refs log tree commit diff stats
path: root/021check_instruction.cc
diff options
context:
space:
mode:
Diffstat (limited to '021check_instruction.cc')
-rw-r--r--021check_instruction.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/021check_instruction.cc b/021check_instruction.cc
index de5d8394..cf0a8d74 100644
--- a/021check_instruction.cc
+++ b/021check_instruction.cc
@@ -117,6 +117,15 @@ bool types_match(const reagent& to, const reagent& from) {
   return types_strictly_match(to, from);
 }
 
+bool types_strictly_match_except_literal_against_boolean(const reagent& to, const reagent& from) {
+  // to sidestep type-checking, use /unsafe in the source.
+  // this will be highlighted in red inside vim. just for setting up some tests.
+  if (is_literal(from)
+      && to.type && to.type->value == get(Type_ordinal, "boolean"))
+    return boolean_matches_literal(to, from);
+  return types_strictly_match(to, from);
+}
+
 bool boolean_matches_literal(const reagent& to, const reagent& from) {
   if (!is_literal(from)) return false;
   if (!to.type) return false;