Skip to content

Commit

Permalink
don't warn about redefining methods in Main (closes #18725) (#19888)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevengj committed Jan 6, 2017
1 parent 32fd14c commit 8192aff
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/gf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1181,16 +1181,18 @@ static void method_overwrite(jl_typemap_entry_t *newentry, jl_method_t *oldvalue
jl_method_t *method = (jl_method_t*)newentry->func.method;
jl_module_t *newmod = method->module;
jl_module_t *oldmod = oldvalue->module;
JL_STREAM *s = JL_STDERR;
jl_printf(s, "WARNING: Method definition ");
jl_static_show_func_sig(s, (jl_value_t*)newentry->sig);
jl_printf(s, " in module %s", jl_symbol_name(oldmod->name));
print_func_loc(s, oldvalue);
jl_printf(s, " overwritten");
if (oldmod != newmod)
jl_printf(s, " in module %s", jl_symbol_name(newmod->name));
print_func_loc(s, method);
jl_printf(s, ".\n");
if (newmod != jl_main_module || oldmod != jl_main_module) {
JL_STREAM *s = JL_STDERR;
jl_printf(s, "WARNING: Method definition ");
jl_static_show_func_sig(s, (jl_value_t*)newentry->sig);
jl_printf(s, " in module %s", jl_symbol_name(oldmod->name));
print_func_loc(s, oldvalue);
jl_printf(s, " overwritten");
if (oldmod != newmod)
jl_printf(s, " in module %s", jl_symbol_name(newmod->name));
print_func_loc(s, method);
jl_printf(s, ".\n");
}
}

static void update_max_args(jl_methtable_t *mt, jl_tupletype_t *type)
Expand Down

0 comments on commit 8192aff

Please sign in to comment.