Open
Description
MWE
struct MyIterator end
function Base.iterate(itr::MyIterator)
# @info "itearte(itr::MyIterator)" itr
return (:first, nothing)
end
Base.iterate(::MyIterator, ::Nothing) = nothing
function Base.show(io::IO, ::MIME"text/plain", itr::MyIterator)
print(io, "MyIterator: ")
join(io, itr, ", ")
end
Commenting out the line with @info
and invoking show
on MyIterator
causes a segfault.
Since it's so easy to put @info
and @debug
for method that might be called from show
, I think it'd be nice to detect infinite recursion. It might be a nice use-case of the context variables JuliaLang/julia#35833 (comment)
Metadata
Metadata
Assignees
Labels
No labels