`show` of `GeneratedKernelError{Msg}` throws for an unbound `Msg`
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- developer-experience
Research direction
The show method for GeneratedKernelError is defined in src/macros.jl, and the reporter's two reproductions are which(show, (IO, Type{G{:x}})) and show(stdout, G{TypeVar(:Msg)}). Start by running those lines to see the UndefVarError, then look at how the method's Msg static parameter is matched when the type argument is a TypeVar. Done means both reproductions print a readable type name without throwing, and printing a normal GeneratedKernelError{:msg} type still shows the message as before.
Written by the indexing model from the issue text.
Description
The show method for GeneratedKernelError types (src/macros.jl) throws when the type parameter is not bound to a value. That happens whenever the method's own signature is printed, e.g. by which or methods, or in a stack frame:
julia> using KernelAbstractions
julia> const G = KernelAbstractions.GeneratedKernelError;
julia> which(show, (IO, Type{G{:x}}))
ERROR: UndefVarError: `Msg` not defined in static parameter matching
julia> show(stdout, G{TypeVar(:Msg)})
ERROR: UndefVarError: `Msg` not defined in static parameter matching
function Base.show(io::IO, ::Type{GeneratedKernelError{Msg}}) where {Msg} also matches GeneratedKernelError{T} for a TypeVar T, but Msg is then not a static parameter value. Restricting the method to a bound message fixes it, for example:
function Base.show(io::IO, T::Type{<:GeneratedKernelError})
T isa DataType && T.parameters[1] isa Symbol ||
return invoke(show, Tuple{IO, Type}, io, T)
msg = T.parameters[1]
...
end
Seen with KernelAbstractions 0.10.0 on Julia 1.12.7, where it broke the printing of some stack frames.
- Dominant language
- Julia
- Stars
- 529
- Forks
- 87
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 65
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from JuliaGPU/KernelAbstractions.jl
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
JuliaGPU/KernelAbstractions.jl#691 · 2 comments ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
JuliaGPU/KernelAbstractions.jl#333 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 12/100
JuliaGPU/KernelAbstractions.jl#894 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 12/100
JuliaGPU/KernelAbstractions.jl#893 ·
Maintainers usually reply within 1 day
-
performance POCL
Difficulty 4/5 3-5 days Newbie friendliness 28/100
JuliaGPU/KernelAbstractions.jl#891 · 1 comment ·
Maintainers usually reply within 1 day
All issues in JuliaGPU/KernelAbstractions.jl
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
oscar-system/GAP.jl#1455 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
JuliaAI/MLJTransforms.jl#85 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
SciML/OrdinaryDiffEq.jl#4875 ·
Maintainers usually reply within 4 days
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day