@@ -2028,7 +2028,7 @@ function show_signature_function(io::IO, @nospecialize(ft), demangle=false, farg
20282028 if ft <: Function && isa (uw, DataType) && isempty (uw. parameters) &&
20292029 isdefined (uw. name. module, uw. name. mt. name) &&
20302030 ft == typeof (getfield (uw. name. module, uw. name. mt. name))
2031- print (io, (demangle ? demangle_function_name : identity)(uw. name. mt. name))
2031+ print_within_stacktrace (io, (demangle ? demangle_function_name : identity)(uw. name. mt. name), bold = true )
20322032 elseif isa (ft, DataType) && ft. name === Type. body. name &&
20332033 (f = ft. parameters[1 ]; ! isa (f, TypeVar))
20342034 uwf = unwrap_unionall (f)
@@ -2040,19 +2040,20 @@ function show_signature_function(io::IO, @nospecialize(ft), demangle=false, farg
20402040 if html
20412041 print (io, " ($fargname ::<b>" , ft, " </b>)" )
20422042 else
2043- print (io, " ($fargname ::" , ft, " )" )
2043+ print_within_stacktrace (io, " ($fargname ::" , ft, " )" , bold = true )
20442044 end
20452045 end
20462046 nothing
20472047end
20482048
2049- function print_within_stacktrace (io, s... ; color, bold= false )
2049+ function print_within_stacktrace (io, s... ; color= :normal , bold= false )
20502050 if get (io, :backtrace , false ):: Bool
20512051 printstyled (io, s... ; color, bold)
20522052 else
20532053 print (io, s... )
20542054 end
20552055end
2056+
20562057function show_tuple_as_call (io:: IO , name:: Symbol , sig:: Type , demangle= false , kwargs= nothing , argnames= nothing )
20572058 # print a method signature tuple for a lambda definition
20582059 if sig === Tuple
@@ -2091,15 +2092,15 @@ function show_tuple_as_call(io::IO, name::Symbol, sig::Type, demangle=false, kwa
20912092 print_type_stacktrace (io, t)
20922093 end
20932094 end
2094- print (io, " )" )
2095+ print_within_stacktrace (io, " )" , bold = true )
20952096 show_method_params (io, tv)
20962097 nothing
20972098end
20982099
20992100function print_type_stacktrace (io, type; color= :normal )
21002101 str = sprint (show, type, context= io)
21012102 i = findfirst (' {' , str)
2102- if isnothing (i)
2103+ if isnothing (i) || ! get (io, :backtrace , false ) :: Bool
21032104 printstyled (io, str; color= color)
21042105 else
21052106 printstyled (io, str[1 : i- 1 ]; color= color)
0 commit comments