From afb685649079cd8b1a403ab16640cfc2175dd7c5 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Mon, 6 Oct 2025 19:35:57 +0000 Subject: [PATCH] add missing depwarn for isdefined checks Without this, we would never be permitted to remove this deprecation, which would have been self-defeating. Make sure to warn if the answer would eventually change (from true->false). --- src/module.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/module.c b/src/module.c index 24ac81266da47..552db4e3e7058 100644 --- a/src/module.c +++ b/src/module.c @@ -1482,9 +1482,10 @@ JL_DLLEXPORT int jl_boundp(jl_module_t *m, jl_sym_t *var, int allow_import) // u return 0; if (jl_bkind_is_defined_constant(kind)) { if (__unlikely(kind == PARTITION_KIND_BACKDATED_CONST)) { - return !(jl_current_task->ptls->in_pure_callback || jl_options.depwarn == JL_OPTIONS_DEPWARN_ERROR); + if (jl_current_task->ptls->in_pure_callback || jl_options.depwarn == JL_OPTIONS_DEPWARN_ERROR) + return 0; + check_backdated_binding(b, kind); } - // N.B.: No backdated admonition for isdefined return 1; } return jl_atomic_load(&b->value) != NULL;