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

Documentation for code_warntype tells to look for @code_warntype but that one is useless #51358

Closed
ulysses4ever opened this issue Sep 17, 2023 · 3 comments · Fixed by #51361
Closed
Labels
docs This change adds or pertains to documentation

Comments

@ulysses4ever
Copy link
Contributor

This is a documentaion issue. Consider the last line of the help message for code_warntype:

help?> code_warntype
search: code_warntype @code_warntype

  code_warntype([io::IO], f, types; debuginfo=:default)

  Prints lowered and type-inferred ASTs for the methods matching
  the given generic function and type signature to io which
  defaults to stdout. The ASTs are annotated in such a way as to
  cause "non-leaf" types which may be problematic for performance
  to be emphasized (if color is available, displayed in red).
  This serves as a warning of potential type instability.

  Not all non-leaf types are particularly problematic for
  performance, and the performance characteristics of a
  particular type is an implementation detail of the compiler.
  code_warntype will err on the side of coloring types red if
  they might be a performance concern, so some types may be
  colored red even if they do not impact performance. Small
  unions of concrete types are usually not a concern, so these
  are highlighted in yellow.

  Keyword argument debuginfo may be one of :source or :none
  (default), to specify the verbosity of code comments.

  See @code_warntype for more information.

So, I'm ready to dive deeper and fire help for @code_warntype:

help?> @code_warntype
  @code_warntype

  Evaluates the arguments to the function or macro call,
  determines their types, and calls code_warntype on the
  resulting expression.

And that is it.

So, either the last line of help for code_warntype should be removed, or help for @code_warntype should be expanded.

julia> versioninfo()
Julia Version 1.9.3
Commit bed2cd540a1 (2023-08-24 14:43 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 16 × AMD Ryzen 9 6900HX with Radeon Graphics
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, znver3)
  Threads: 1 on 16 virtual cores

Julia installed with snap.

@brenhinkeller brenhinkeller added the docs This change adds or pertains to documentation label Sep 17, 2023
@brenhinkeller
Copy link
Contributor

Should possibly just say "see also" rather than "for more information"

@ulysses4ever
Copy link
Contributor Author

Yep, that would work too.

@ulysses4ever
Copy link
Contributor Author

I submitted a PR to that effect: #51361.

KristofferC pushed a commit that referenced this issue Feb 8, 2024
KristofferC pushed a commit that referenced this issue Feb 26, 2024
fix #51358

---------

Co-authored-by: Fredrik Ekre <[email protected]>
Co-authored-by: Max Horn <[email protected]>
(cherry picked from commit 5cb5cd8)
KristofferC pushed a commit that referenced this issue Feb 26, 2024
fix #51358

---------

Co-authored-by: Fredrik Ekre <[email protected]>
Co-authored-by: Max Horn <[email protected]>
(cherry picked from commit 5cb5cd8)
Drvi pushed a commit to RelationalAI/julia that referenced this issue Jun 7, 2024
…ng#51361)

fix JuliaLang#51358

---------

Co-authored-by: Fredrik Ekre <[email protected]>
Co-authored-by: Max Horn <[email protected]>
(cherry picked from commit 5cb5cd8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants