Repository: lucy-clownfish Updated Branches: refs/heads/master 7a6825dc0 -> d6276a5ff
Fix CFCMethod_imp_func Make sure that CFCMethod_imp_func returns the symbol for the class in which the method is fresh. Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/d6276a5f Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/d6276a5f Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/d6276a5f Branch: refs/heads/master Commit: d6276a5ffc4ebd9f477df12686d06985171bcac0 Parents: 7a6825d Author: Nick Wellnhofer <[email protected]> Authored: Tue May 12 13:10:22 2015 +0200 Committer: Nick Wellnhofer <[email protected]> Committed: Tue May 12 13:10:22 2015 +0200 ---------------------------------------------------------------------- compiler/src/CFCMethod.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/d6276a5f/compiler/src/CFCMethod.c ---------------------------------------------------------------------- diff --git a/compiler/src/CFCMethod.c b/compiler/src/CFCMethod.c index 406a4f5..8a142d1 100644 --- a/compiler/src/CFCMethod.c +++ b/compiler/src/CFCMethod.c @@ -406,7 +406,18 @@ CFCMethod_get_param_list(CFCMethod *self) { char* CFCMethod_imp_func(CFCMethod *self, CFCClass *klass) { - return S_full_method_sym(self, klass, "_IMP"); + CFCClass *ancestor = klass; + + while (ancestor) { + if (CFCMethod_is_fresh(self, ancestor)) { break; } + ancestor = CFCClass_get_parent(ancestor); + } + if (!ancestor) { + CFCUtil_die("No fresh method implementation found for '%s' in '%s'", + CFCMethod_get_name(self), CFCClass_get_name(klass)); + } + + return S_full_method_sym(self, ancestor, "_IMP"); } char*
