Skip to content

Conversation

Keno
Copy link
Member

@Keno Keno commented Jun 6, 2025

This makes two changes to the backdate-warning-turned-error (#58266):

  1. Fix a bug where the error would only trigger the first time. We do only want to print once per process, but of course, we do want to error every time if enabled.
  2. If we are in speculative execution context (generators and speculatively run functions during inference), always use the UndefVarError. Effects from these functions are not supposed to be observable, and it's very confusing if the printed warning goes away when depwarns are enabled. This is marginally more breaking, but the burden is on generated function authors (which already have to be world-age aware and are somewhat more regularly broken) and is consistent with other things that are stronger errors in pure context.

Fixes #58648

This makes two changes to the backdate-warning-turned-error (#58266):
1. Fix a bug where the error would only trigger the first time. We do only want
   to print once per process, but of course, we do want to error every time if
   enabled.
2. If we are in speculative execution context (generators and speculatively run
   functions during inference), always use the UndefVarError. Effects from these
   functions are not supposed to be observable, and it's very confusing if the
   printed warning goes away when depwarns are enabled. This is marginally more
   breaking, but the burden is on generated function authors (which already have
   to be world-age aware and are somewhat more regularly broken) and is consistent
   with other things that are stronger errors in pure context.

Fixes #58648
@Keno Keno merged commit d2cc061 into master Jun 6, 2025
6 of 9 checks passed
@Keno Keno deleted the kf/tweakbackdatedepwarnerror branch June 6, 2025 17:27
KristofferC pushed a commit that referenced this pull request Jun 6, 2025
This makes two changes to the backdate-warning-turned-error (#58266):
1. Fix a bug where the error would only trigger the first time. We do
only want to print once per process, but of course, we do want to error
every time if enabled.
2. If we are in speculative execution context (generators and
speculatively run functions during inference), always use the
UndefVarError. Effects from these functions are not supposed to be
observable, and it's very confusing if the printed warning goes away
when depwarns are enabled. This is marginally more breaking, but the
burden is on generated function authors (which already have to be
world-age aware and are somewhat more regularly broken) and is
consistent with other things that are stronger errors in pure context.

Fixes #58648

(cherry picked from commit d2cc061)
@KristofferC KristofferC mentioned this pull request Jun 6, 2025
60 tasks
nilesh646 pushed a commit to nilesh646/julia that referenced this pull request Jun 17, 2025
This makes two changes to the backdate-warning-turned-error (JuliaLang#58266):
1. Fix a bug where the error would only trigger the first time. We do
only want to print once per process, but of course, we do want to error
every time if enabled.
2. If we are in speculative execution context (generators and
speculatively run functions during inference), always use the
UndefVarError. Effects from these functions are not supposed to be
observable, and it's very confusing if the printed warning goes away
when depwarns are enabled. This is marginally more breaking, but the
burden is on generated function authors (which already have to be
world-age aware and are somewhat more regularly broken) and is
consistent with other things that are stronger errors in pure context.

Fixes JuliaLang#58648
@KristofferC KristofferC removed the backport 1.12 Change should be backported to release-1.12 label Jul 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

--depwarn=error silences the "world prior to its definition world" warning, instead of making it an error
3 participants