From 875aaa4cbab1823dbe11ef919bf57d00e9436048 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Fri, 2 Jan 2015 14:13:30 -0500 Subject: [PATCH] fix #9547, restore explicit-import error for functions --- src/module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/module.c b/src/module.c index 7a8eba721e6770..ade9972ed3087e 100644 --- a/src/module.c +++ b/src/module.c @@ -97,7 +97,7 @@ jl_binding_t *jl_get_binding_for_method_def(jl_module_t *m, jl_sym_t *var) jl_binding_t *b2 = jl_get_binding(b->owner, var); if (b2 == NULL) jl_errorf("invalid method definition: imported function %s.%s does not exist", b->owner->name->name, var->name); - if (!b->imported && b->value!=NULL && jl_is_function(b->value)) + if (!b->imported && (b2->value==NULL || jl_is_function(b2->value))) jl_errorf("error in method definition: function %s.%s must be explicitly imported to be extended", b->owner->name->name, var->name); return b2; }