Skip to content

Commit 219dc10

Browse files
authored
Clarify Vararg/UnionAll deprecation warning (#49558)
Fixes #49553
1 parent 645f7af commit 219dc10

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/jltypes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -831,8 +831,8 @@ JL_DLLEXPORT jl_value_t *jl_type_unionall(jl_tvar_t *v, jl_value_t *body)
831831
if (jl_is_vararg(body)) {
832832
if (jl_options.depwarn) {
833833
if (jl_options.depwarn == JL_OPTIONS_DEPWARN_ERROR)
834-
jl_error("Wrapping `Vararg` directly in UnionAll is deprecated (wrap the tuple instead).");
835-
jl_printf(JL_STDERR, "WARNING: Wrapping `Vararg` directly in UnionAll is deprecated (wrap the tuple instead).\n");
834+
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)`.");
835+
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");
836836
}
837837
jl_vararg_t *vm = (jl_vararg_t*)body;
838838
int T_has_tv = vm->T && jl_has_typevar(vm->T, v);

0 commit comments

Comments
 (0)