Skip to content

add traced_type_inner method for Union{A,B} - #3186

Draft
mofeing wants to merge 1 commit into
mainfrom
ss/fix-trace-union
Draft

add traced_type_inner method for Union{A,B}#3186
mofeing wants to merge 1 commit into
mainfrom
ss/fix-trace-union

Conversation

@mofeing

@mofeing mofeing commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

fixes #3185 (well, still checking out)

cc @gdalle

Comment thread src/Tracing.jl
return T
end

Base.@nospecializeinfer function traced_type_inner(@nospecialize(_::Type{Union{A,B}}), @nospecialize(args...)) where {A,B}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
Base.@nospecializeinfer function traced_type_inner(@nospecialize(_::Type{Union{A,B}}), @nospecialize(args...)) where {A,B}
Base.@nospecializeinfer function traced_type_inner(
@nospecialize(_::Type{Union{A,B}}), @nospecialize(args...)
) where {A,B}

@glou-nes

glou-nes commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Got infinite precompilation (and no print at all), even without the recursive part. For instance, with this in 1.12:

Base.@nospecializeinfer function traced_type_inner(
    @nospecialize(_::Type{Union{A,B}}), @nospecialize(args...)
) where {A,B}
    ccall(:jl_, Cvoid, (Any,), name * " " * string(stacktrace()))
    return Nothing
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracing structs with Union type bounds

2 participants