From 84fe737e19cf213ff9eaffee1f6460ea4b2a2cbf Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Tue, 15 Feb 2022 18:46:53 +0100 Subject: [PATCH] fix UndefRefError for documentation system (#44060) * fix UndefRefError for documentation system * add a test Co-authored-by: Jameson Nash (cherry picked from commit 48420071e36cffb15e1166a1e65a359d58c6d9b4) --- stdlib/REPL/src/docview.jl | 2 +- stdlib/REPL/test/docview.jl | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/stdlib/REPL/src/docview.jl b/stdlib/REPL/src/docview.jl index f4467b3e787bc..2d866d1ea05ce 100644 --- a/stdlib/REPL/src/docview.jl +++ b/stdlib/REPL/src/docview.jl @@ -283,7 +283,7 @@ function summarize(io::IO, TT::Type, binding::Binding) println(io, "# Fields") println(io, "```") pad = maximum(length(string(f)) for f in fieldnames(T)) - for (f, t) in zip(fieldnames(T), T.types) + for (f, t) in zip(fieldnames(T), fieldtypes(T)) println(io, rpad(f, pad), " :: ", t) end println(io, "```") diff --git a/stdlib/REPL/test/docview.jl b/stdlib/REPL/test/docview.jl index 160544eb475d2..9757cdb5df097 100644 --- a/stdlib/REPL/test/docview.jl +++ b/stdlib/REPL/test/docview.jl @@ -51,3 +51,11 @@ end @testset "Unicode doc lookup (#41589)" begin @test REPL.lookup_doc(:(รท=)) isa Markdown.MD end + +@testset "#44009" begin + R = Complex{<:Integer} + b = REPL.Binding(@__MODULE__, :R) + @test REPL.summarize(b, Tuple{}) isa Markdown.MD +end + +