From 0041da93b1bc434057e1d39c0e7c5a1f11b21097 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki Date: Mon, 22 Apr 2024 18:03:17 +0900 Subject: [PATCH] rm dead check --- src/ui/print.jl | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/ui/print.jl b/src/ui/print.jl index d7967400b..6b5bceb75 100644 --- a/src/ui/print.jl +++ b/src/ui/print.jl @@ -38,8 +38,8 @@ The configurations below will be active whenever `show`ing [JET's analysis resul --- - `stacktrace_types_limit::Union{Nothing, Int} = nothing` \\ If `nothing`, limit type-depth printing of argument types in stack traces based on the display size. - If a positive `Int`, limit type-depth printing to given depth - If a non-positive `Int`, do not limit type-depth printing + If a positive `Int`, limit type-depth printing to given depth. + If a non-positive `Int`, do not limit type-depth printing. --- """ struct PrintConfig @@ -100,8 +100,8 @@ end colorctx(io::IO) = :color => get(io, :color, false) -should_limit(stacktrace_types_limit::Nothing)::Bool = true -should_limit(stacktrace_types_limit::Int)::Bool = stacktrace_types_limit > 0 +should_limit(stacktrace_types_limit::Nothing) = true +should_limit(stacktrace_types_limit::Int) = stacktrace_types_limit > 0 function type_depth_limit(io::IO, s::String; maxtypedepth::Union{Nothing,Int}) sz = get(io, :displaysize, displaysize(io))::Tuple{Int, Int} return Base.type_depth_limit(s, max(sz[2], 120); maxdepth=maxtypedepth) @@ -300,11 +300,7 @@ function _print_signature(io, @nospecialize(x); kwargs...) if isa(x, Type) if x == pairs(NamedTuple) # special case common verbose types related to keyword arguments - if isdefined(Base, Symbol("@Kwargs")) - printstyled(io, "::@Kwargs{…}"; color = TYPE_ANNOTATION_COLOR, kwargs...) - else - printstyled(io, "::Base.Pairs{…}"; color = TYPE_ANNOTATION_COLOR, kwargs...) - end + printstyled(io, "::@Kwargs{…}"; color = TYPE_ANNOTATION_COLOR, kwargs...) elseif x !== Union{} io = IOContext(io, :backtrace=>true) printstyled(io, "::", x; color = TYPE_ANNOTATION_COLOR, kwargs...)