@@ -999,6 +999,33 @@ function show(io::IO, l::Core.MethodInstance)
999
999
end
1000
1000
end
1001
1001
1002
+ # These sometimes show up as Const-values in InferenceFrameInfo signatures
1003
+ show (io:: IO , r:: Core.Compiler.UnitRange ) = show (io, r. start : r. stop)
1004
+ show (io:: IO , mime:: MIME{Symbol("text/plain")} , r:: Core.Compiler.UnitRange ) = show (io, mime, r. start : r. stop)
1005
+
1006
+ function show (io:: IO , mi_info:: Core.Compiler.Timings.InferenceFrameInfo )
1007
+ mi = mi_info. mi
1008
+ def = mi. def
1009
+ if isa (def, Method)
1010
+ if isdefined (def, :generator ) && mi === def. generator
1011
+ print (io, " InferenceFrameInfo generator for " )
1012
+ show (io, def)
1013
+ else
1014
+ print (io, " InferenceFrameInfo for " )
1015
+ argnames = [isa (a, Core. Const) ? (isa (a. val, Type) ? " " : a. val) : " " for a in mi_info. slottypes[1 : mi_info. nargs]]
1016
+ show_tuple_as_call (io, def. name, mi. specTypes, false , nothing , argnames, true )
1017
+ end
1018
+ else
1019
+ linetable = mi. uninferred. linetable
1020
+ line = isempty (linetable) ? " " : (lt = linetable[1 ]; string (lt. file) * ' :' * string (lt. line))
1021
+ print (io, " Toplevel InferenceFrameInfo thunk from " , def, " starting at " , line)
1022
+ end
1023
+ end
1024
+
1025
+ function show (io:: IO , tinf:: Core.Compiler.Timings.Timing )
1026
+ print (io, " Core.Compiler.Timings.Timing(" , tinf. mi_info, " ) with " , length (tinf. children), " children" )
1027
+ end
1028
+
1002
1029
function show_delim_array (io:: IO , itr:: Union{AbstractArray,SimpleVector} , op, delim, cl,
1003
1030
delim_one, i1= first (LinearIndices (itr)), l= last (LinearIndices (itr)))
1004
1031
print (io, op)
@@ -2103,11 +2130,14 @@ end
2103
2130
2104
2131
# show the called object in a signature, given its type `ft`
2105
2132
# `io` should contain the UnionAll env of the signature
2106
- function show_signature_function (io:: IO , @nospecialize (ft), demangle= false , fargname= " " , html= false )
2133
+ function show_signature_function (io:: IO , @nospecialize (ft), demangle= false , fargname= " " , html= false , qualified = false )
2107
2134
uw = unwrap_unionall (ft)
2108
2135
if ft <: Function && isa (uw, DataType) && isempty (uw. parameters) &&
2109
2136
isdefined (uw. name. module, uw. name. mt. name) &&
2110
2137
ft == typeof (getfield (uw. name. module, uw. name. mt. name))
2138
+ if qualified && ! is_exported_from_stdlib (uw. name. mt. name, uw. name. module) && uw. name. module != = Main
2139
+ print_within_stacktrace (io, uw. name. module, ' .' , bold= true )
2140
+ end
2111
2141
s = sprint (show_sym, (demangle ? demangle_function_name : identity)(uw. name. mt. name), context= io)
2112
2142
print_within_stacktrace (io, s, bold= true )
2113
2143
elseif isa (ft, DataType) && ft. name === Type. body. name &&
@@ -2135,7 +2165,7 @@ function print_within_stacktrace(io, s...; color=:normal, bold=false)
2135
2165
end
2136
2166
end
2137
2167
2138
- function show_tuple_as_call (io:: IO , name:: Symbol , sig:: Type , demangle= false , kwargs= nothing , argnames= nothing )
2168
+ function show_tuple_as_call (io:: IO , name:: Symbol , sig:: Type , demangle= false , kwargs= nothing , argnames= nothing , qualified = false )
2139
2169
# print a method signature tuple for a lambda definition
2140
2170
if sig === Tuple
2141
2171
print (io, demangle ? demangle_function_name (name) : name, " (...)" )
@@ -2149,7 +2179,7 @@ function show_tuple_as_call(io::IO, name::Symbol, sig::Type, demangle=false, kwa
2149
2179
sig = sig. body
2150
2180
end
2151
2181
sig = (sig:: DataType ). parameters
2152
- show_signature_function (env_io, sig[1 ], demangle)
2182
+ show_signature_function (env_io, sig[1 ], demangle, " " , false , qualified )
2153
2183
first = true
2154
2184
print_within_stacktrace (io, " (" , bold= true )
2155
2185
show_argnames = argnames != = nothing && length (argnames) == length (sig)
0 commit comments