This change:
================================
r1085159 | marvin | 2011-03-24 17:02:51 -0500 (Thu, 24 Mar 2011) | 4 lines

LUCY-138 ftype_equals.patch
Have FType_Equals() return false whenever classes for "self" and "other" don't
match.
================================

is causing some of my existing code to break.

The change was this:

Index: core/Lucy/Plan/FieldType.c
===================================================================
--- core/Lucy/Plan/FieldType.c  (revision 1085158)
+++ core/Lucy/Plan/FieldType.c  (revision 1085159)
@@ -87,6 +87,7 @@
 {
     FieldType *evil_twin = (FieldType*)other;
     if (evil_twin == self) return true;
+    if (FType_Get_VTable(self) != FType_Get_VTable(evil_twin)) return false;
     if (self->boost != evil_twin->boost) return false;
     if (!!self->indexed    != !!evil_twin->indexed)    return false;
     if (!!self->stored     != !!evil_twin->stored)     return false;



When I add some verbosity to the resulting error message:

Index: core/Lucy/Plan/Schema.c

@@ -108,7 +108,7 @@
     // If the field already has an association, verify pairing and return.
     if (existing) {
         if (FType_Equals(type, (Obj*)existing)) { return; }
-        else { THROW(ERR, "'%o' assigned conflicting FieldType", field); }
+        else { THROW(ERR, "'%o' cannot be %o because already assigned \
conflicting FieldType %o", field, existing, type); }
     }

     if (FType_Is_A(type, FULLTEXTTYPE)) {



I get this, for example:

'foo' cannot be Lucy::FieldType::FullTextType@0x000000010190d870 because already
assigned conflicting FieldType Lucy::Plan::FullTextType@0x000000010193bfe0



All of which makes me think that the comparison being done isn't really between
classes, as the commit message claims, because the objects compared are, in
fact, instances of the same class.

What am I missing?

-- 
Peter Karman  .  http://peknet.com/  .  [email protected]

Reply via email to