Fix comparisons of derived tags (bug 6239).

This commit is contained in:
David Anderson
2014-11-08 20:27:39 -08:00
parent 7609d19e32
commit 704e9579f7
3 changed files with 21 additions and 2 deletions
+2 -2
View File
@@ -550,7 +550,7 @@ int matchtag(int formaltag, int actualtag, int flags)
return TRUE;
}
if (flags & MATCHTAG_COERCE) {
if (flags & (MATCHTAG_COERCE|MATCHTAG_DEDUCE)) {
// See if the tag has a methodmap associated with it. If so, see if the given
// tag is anywhere on the inheritance chain.
methodmap_t *map = methodmap_find_by_tag(actualtag);
@@ -888,7 +888,7 @@ static void plnge2(void (*oper)(void),
} else {
// For the purposes of tag matching, we consider the order to be irrelevant.
if (!checktag_string(lval1, lval2))
matchtag(lval1->tag, lval2->tag, MATCHTAG_COMMUTATIVE);
matchtag(lval1->tag, lval2->tag, MATCHTAG_COMMUTATIVE|MATCHTAG_DEDUCE);
(*oper)(); /* do the (signed) operation */
lval1->ident=iEXPRESSION;
} /* if */