JuliaDebug / JuliaDebug/Cthulhu.jl

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

Open
#533 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Julia
Stars
709
Forks
46
Avg merge
1d 13h
Merged PRs (30d)
2

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the @descend_code_warntype and @code_warntype entry points and inspect how union return types are colored, focusing on the Base.warn_color() behavior named in the title. Reproduce the Bidiagonal example on Julia nightly, then verify that both commands display these return types with identical colors.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
devtools
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.