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

Redundant suggestion printed on an UndefVarError on nightly #52273

Closed
jishnub opened this issue Nov 22, 2023 · 2 comments · Fixed by #52280
Closed

Redundant suggestion printed on an UndefVarError on nightly #52273

jishnub opened this issue Nov 22, 2023 · 2 comments · Fixed by #52280
Labels
error messages Better, more actionable error messages

Comments

@jishnub
Copy link
Contributor

jishnub commented Nov 22, 2023

julia> a
ERROR: UndefVarError: `a` not defined in `Main`
Suggestion: check for spelling errors or missing imports. No global of this name exists in this module.

The suggestion text "No global of this name exists in this module" appears to repeat the error message "a not defined in Main", and in less-obvious language. It's also not a suggestion, but an observation.

Versioninfo:

julia> versioninfo()
Julia Version 1.11.0-DEV.958
Commit a6c656e6c47 (2023-11-21 21:06 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 8 × 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
  WORD_SIZE: 64
  LLVM: libLLVM-15.0.7 (ORCJIT, tigerlake)
  Threads: 1 on 8 virtual cores
Environment:
  LD_LIBRARY_PATH = :/usr/lib/x86_64-linux-gnu/gtk-3.0/modules
  JULIA_EDITOR = subl
@jishnub jishnub added the error messages Better, more actionable error messages label Nov 22, 2023
@vtjnash
Copy link
Sponsor Member

vtjnash commented Nov 22, 2023

Formally speaking, the message is telling you that there is also no global a declaration anywhere, as opposed to the first text that is just telling you !isdefined(Main, :a), so it is the error message that is the repeat of the observation, not the reverse.

There is both a suggestion followed by an observation, separated into sentences by a period.

@jishnub
Copy link
Contributor Author

jishnub commented Nov 22, 2023

This distinction seems quite technical, and wasn't obvious to me despite being relatively familiar with Julia. I wonder if the framing might be improved? Also, perhaps the observation should precede the suggestion to avoid it being seen as a part of the solution. As a non-native speaker, "No global of this name exists in the module. Suggestion: check for spelling errors or missing imports" sounds clearer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error messages Better, more actionable error messages
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants