Skip to content

Commit

Permalink
Clarify Vararg/UnionAll deprecation warning (JuliaLang#49558)
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy authored Apr 29, 2023
1 parent 645f7af commit 219dc10
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/jltypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -831,8 +831,8 @@ JL_DLLEXPORT jl_value_t *jl_type_unionall(jl_tvar_t *v, jl_value_t *body)
if (jl_is_vararg(body)) {
if (jl_options.depwarn) {
if (jl_options.depwarn == JL_OPTIONS_DEPWARN_ERROR)
jl_error("Wrapping `Vararg` directly in UnionAll is deprecated (wrap the tuple instead).");
jl_printf(JL_STDERR, "WARNING: Wrapping `Vararg` directly in UnionAll is deprecated (wrap the tuple instead).\n");
jl_error("Wrapping `Vararg` directly in UnionAll is deprecated (wrap the tuple instead).\nYou may need to write `f(x::Vararg{T})` rather than `f(x::Vararg{<:T})` or `f(x::Vararg{T}) where T` instead of `f(x::Vararg{T} where T)`.");
jl_printf(JL_STDERR, "WARNING: Wrapping `Vararg` directly in UnionAll is deprecated (wrap the tuple instead).\nYou may need to write `f(x::Vararg{T})` rather than `f(x::Vararg{<:T})` or `f(x::Vararg{T}) where T` instead of `f(x::Vararg{T} where T)`.\n");
}
jl_vararg_t *vm = (jl_vararg_t*)body;
int T_has_tv = vm->T && jl_has_typevar(vm->T, v);
Expand Down

0 comments on commit 219dc10

Please sign in to comment.