From 32b8fac2799ac7cec613e84a3eb9c009141b6a3a Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 25 Apr 2016 22:27:19 -0700 Subject: 2866 --- html/021check_instruction.cc.html | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'html/021check_instruction.cc.html') diff --git a/html/021check_instruction.cc.html b/html/021check_instruction.cc.html index 580a32f6..7771ea55 100644 --- a/html/021check_instruction.cc.html +++ b/html/021check_instruction.cc.html @@ -191,10 +191,23 @@ $error: 0 bool types_strictly_match(type_tree* to, type_tree* from) { if (!to) return true; if (!from) return to->value == 0; + if (from->value == -1) return from->name == to->name; if (to->value != from->value) return false; return types_strictly_match(to->left, from->left) && types_strictly_match(to->right, from->right); } +void test_unknown_type_does_not_match_unknown_type() { + reagent a("a:foo"); + reagent b("b:bar"); + CHECK(!types_strictly_match(a, b)); +} + +void test_unknown_type_matches_itself() { + reagent a("a:foo"); + reagent b("b:foo"); + CHECK(types_strictly_match(a, b)); +} + bool is_unsafe(const reagent& r) { return has_property(r, "unsafe"); } -- cgit 1.4.1-2-gfad0