You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2013/06/07 18:10:21 UTC

[lucy-commits] [06/16] git commit: refs/heads/separate-clownfish-wip4 - Fix Perl bindings for methods from other parcels

Fix Perl bindings for methods from other parcels

The old solution was too simplistic.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/80a57c12
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/80a57c12
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/80a57c12

Branch: refs/heads/separate-clownfish-wip4
Commit: 80a57c12bbbf0508488f6ea43118f86bb0d6b796
Parents: 102a482
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Thu Jun 6 23:44:52 2013 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Fri Jun 7 17:40:38 2013 +0200

----------------------------------------------------------------------
 clownfish/compiler/src/CFCPerlClass.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/80a57c12/clownfish/compiler/src/CFCPerlClass.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCPerlClass.c b/clownfish/compiler/src/CFCPerlClass.c
index b571f9c..9c29429 100644
--- a/clownfish/compiler/src/CFCPerlClass.c
+++ b/clownfish/compiler/src/CFCPerlClass.c
@@ -258,8 +258,6 @@ CFCPerlClass_method_bindings(CFCPerlClass *self) {
     CFCPerlMethod **bound 
         = (CFCPerlMethod**)CALLOCATE(1, sizeof(CFCPerlMethod*));
 
-    int parent_included = (parent && CFCClass_included(parent));
- 
      // Iterate over the class's fresh methods.
     for (size_t i = 0; fresh_methods[i] != NULL; i++) {
         CFCMethod  *method    = fresh_methods[i];
@@ -267,8 +265,13 @@ CFCPerlClass_method_bindings(CFCPerlClass *self) {
         const char *meth_name = CFCMethod_get_macro_sym(method);
 
         // Only deal with methods when they are novel (i.e. first declared)
-        // or the parent class is included.
-        if (!CFCMethod_novel(method) && !parent_included) { continue; }
+        // or the parent's definition is from an included parcel (i.e. they
+        // are first declared in this parcel).
+        if (!CFCMethod_novel(method)) {
+            CFCMethod *parent_method = CFCClass_method(parent, meth_name);
+            CFCParcel *parcel = CFCMethod_get_parcel(parent_method);
+            if (!CFCParcel_included(parcel)) { continue; }
+        }
 
         // Skip private methods.
         if (CFCSymbol_private((CFCSymbol*)method)) { continue; }