Skip to content

Commit

Permalink
Workaround incorrect Uint deprecation message
Browse files Browse the repository at this point in the history
The Uint deprecation warning suggested a system dependent type (UInt64
or UInt32) rather than UInt, due to this being a type alias.  Hardcode a
warning message for this rather common type, pending a more powerful
deprecation warning system.

(cherry picked from commit 9723ec0)
ref #13227
  • Loading branch information
c42f authored and tkelman committed Sep 23, 2015
1 parent 115b488 commit ae54d22
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,15 @@ void jl_binding_deprecation_warning(jl_binding_t *b)
jl_value_t *v = b->value;
if (v && (jl_is_type(v) || (jl_is_function(v) && jl_is_gf(v)))) {
jl_printf(JL_STDERR, ", use ");
jl_static_show(JL_STDERR, v);
if (b->owner && strcmp(b->owner->name->name, "Base") == 0 &&
strcmp(b->name->name, "Uint") == 0) {
// TODO: Suggesting type b->value is wrong for typealiases.
// Uncommon in Base, hardcoded here for now, see #13221
jl_printf(JL_STDERR, "UInt");
}
else {
jl_static_show(JL_STDERR, v);
}
jl_printf(JL_STDERR, " instead");
}
jl_printf(JL_STDERR, ".\n");
Expand Down

0 comments on commit ae54d22

Please sign in to comment.