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

Display certain unions with Base.warn_color() to match code_warntype #533

Open
jishnub opened this issue Jan 11, 2024 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@jishnub
Copy link
Contributor

jishnub commented Jan 11, 2024

On Julia nightly,

julia> using LinearAlgebra

julia> @code_warntype rand(3,3) \ Bidiagonal(1:3, 1:2, :U)

vs

julia> @descend_code_warntype rand(3,3) \ Bidiagonal(1:3, 1:2, :U)

show the return types with different colors. @code_warntype uses yellow, whereas @descend_code_warntype uses red. It would be good for these to be identical.

Cthulhu:

@code_warntype:

This is on the master branch of Cthulhu with

julia> versioninfo()
Julia Version 1.11.0-DEV.1247
Commit 2afc20c18a8 (2024-01-10 16:38 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-16.0.6 (ORCJIT, tigerlake)
Threads: 1 default, 0 interactive, 1 GC (on 8 virtual cores)
Environment:
  LD_LIBRARY_PATH = :/usr/lib/x86_64-linux-gnu/gtk-3.0/modules
  JULIA_EDITOR = subl

(Cthulhu) pkg> st
Project Cthulhu v2.10.0
Status `~/Dropbox/JuliaPackages/Cthulhu.jl/Project.toml`
  [da1fd8a2] CodeTracking v1.3.5
  [1eca21be] FoldingTrees v1.2.1
  [70703baa] JuliaSyntax v0.4.8
  [aea7be01] PrecompileTools v1.2.0
  [21216c6a] Preferences v1.4.1
  [d265eb64] TypedSyntax v1.2.4
  [b8c1c048] WidthLimitedIO v1.0.1
  [b77e0a4c] InteractiveUtils v1.11.0
  [3fa0cd96] REPL v1.11.0
  [cf7118a7] UUIDs v1.11.0
  [4ec0a83e] Unicode v1.11.0
@Zentrik
Copy link
Collaborator

Zentrik commented Jan 15, 2024

If anyone wants to fix,

color = is_small_union_or_tunion(T) ? :yellow : :red

@simeonschaub simeonschaub added the enhancement New feature or request label Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants