Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix variable naming confusion in warn_if_already_loaded_different() #52778

Merged
merged 1 commit into from
Jan 6, 2024

Conversation

staticfloat
Copy link
Sponsor Member

Without this, it is possible to run into an error that looks like:

ERROR: LoadError: UndefVarError: `v` not defined in local scope
Suggestion: check for an assignment to a local variable that shadows a
global of the same name.
Stacktrace:
  [1] warn_if_already_loaded_different(uuidkey::Base.PkgId)
    @ Base ./loading.jl:1998
  [2] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1980
  [3] #invoke_in_world#3
    @ Base ./essentials.jl:989 [inlined]
  [4] invoke_in_world
    @ Base ./essentials.jl:986 [inlined]
  [5] _require_prelocked
    @ Base ./loading.jl:1962 [inlined]
  [6] macro expansion
    @ Base ./loading.jl:1900 [inlined]
  [7] macro expansion
    @ Base ./lock.jl:269 [inlined]
  [8] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1861
  [9] #invoke_in_world#3
    @ Base ./essentials.jl:989 [inlined]
 [10] invoke_in_world
    @ Base ./essentials.jl:986 [inlined]
 [11] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1854

Without this, it is possible to run into an error that looks like:

```
ERROR: LoadError: UndefVarError: `v` not defined in local scope
Suggestion: check for an assignment to a local variable that shadows a
global of the same name.
Stacktrace:
  [1] warn_if_already_loaded_different(uuidkey::Base.PkgId)
    @ Base ./loading.jl:1998
  [2] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1980
  [3] #invoke_in_world#3
    @ Base ./essentials.jl:989 [inlined]
  [4] invoke_in_world
    @ Base ./essentials.jl:986 [inlined]
  [5] _require_prelocked
    @ Base ./loading.jl:1962 [inlined]
  [6] macro expansion
    @ Base ./loading.jl:1900 [inlined]
  [7] macro expansion
    @ Base ./lock.jl:269 [inlined]
  [8] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1861
  [9] #invoke_in_world#3
    @ Base ./essentials.jl:989 [inlined]
 [10] invoke_in_world
    @ Base ./essentials.jl:986 [inlined]
 [11] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1854
```
@staticfloat
Copy link
Sponsor Member Author

@ven-k I think this is actually the fundamental error we were seeing.

@ven-k
Copy link
Member

ven-k commented Jan 6, 2024

Nice catch. This must be it.

Copy link
Sponsor Member

@IanButterworth IanButterworth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. My bad (I took over that PR)

@IanButterworth IanButterworth removed the request for review from KristofferC January 6, 2024 14:46
@IanButterworth IanButterworth added the status:merge me PR is reviewed. Merge when all tests are passing label Jan 6, 2024
@IanButterworth IanButterworth merged commit c827094 into master Jan 6, 2024
5 of 8 checks passed
@IanButterworth IanButterworth deleted the sf/fix_undef_var_error branch January 6, 2024 18:07
IanButterworth added a commit to IanButterworth/julia that referenced this pull request Jan 7, 2024
@IanButterworth IanButterworth removed the status:merge me PR is reviewed. Merge when all tests are passing label Jan 13, 2024
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.

None yet

3 participants