Repository: lucy-clownfish Updated Branches: refs/heads/master 0bd951aa9 -> 6f4f79e20
Try to lookup constructor POD by alias Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/6f4f79e2 Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/6f4f79e2 Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/6f4f79e2 Branch: refs/heads/master Commit: 6f4f79e20c450d8477379de69070201a1cc5481c Parents: f71e072 Author: Nick Wellnhofer <[email protected]> Authored: Tue Aug 25 12:23:40 2015 +0200 Committer: Nick Wellnhofer <[email protected]> Committed: Sun Aug 30 19:16:42 2015 +0200 ---------------------------------------------------------------------- compiler/src/CFCPerlPod.c | 7 +++++++ 1 file changed, 7 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/6f4f79e2/compiler/src/CFCPerlPod.c ---------------------------------------------------------------------- diff --git a/compiler/src/CFCPerlPod.c b/compiler/src/CFCPerlPod.c index 3699acd..822ee69 100644 --- a/compiler/src/CFCPerlPod.c +++ b/compiler/src/CFCPerlPod.c @@ -268,6 +268,13 @@ CFCPerlPod_constructors_pod(CFCPerlPod *self, CFCClass *klass) { } else { CFCFunction *init_func = CFCClass_function(klass, slot.func); + if (!init_func) { + init_func = CFCClass_function(klass, slot.alias); + } + if (!init_func) { + CFCUtil_die("Can't find constructor '%s' in class '%s'", + slot.alias, CFCClass_get_name(klass)); + } char *sub_pod = CFCPerlPod_gen_subroutine_pod(init_func, slot.alias, klass, slot.sample, class_name, true);
