Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

methodshow: single-line printing for Method by default #46241

Merged
merged 2 commits into from
Aug 6, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup
  • Loading branch information
aviatesk committed Aug 4, 2022
commit 3f33e68414a17a86ef5ae0f9e1cdeeb1e46ab2e6
3 changes: 1 addition & 2 deletions doc/src/devdocs/inference.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ Each statement gets analyzed for its total cost in a function called
as follows:
```jldoctest; filter=r"tuple.jl:\d+"
julia> Base.print_statement_costs(stdout, map, (typeof(sqrt), Tuple{Int},)) # map(sqrt, (2,))
map(f, t::Tuple{Any})
@ Base tuple.jl:273
map(f, t::Tuple{Any}) @ Base tuple.jl:273
0 1 ─ %1 = Base.getfield(_3, 1, true)::Int64
1 │ %2 = Base.sitofp(Float64, %1)::Float64
2 │ %3 = Base.lt_float(%2, 0.0)::Bool
Expand Down
1 change: 0 additions & 1 deletion stdlib/InteractiveUtils/test/highlighting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ myzeros(::Type{T}, ::Type{S}, ::Type{R}, dims::Tuple{Vararg{Integer, N}}, dims2:
seekstart(io)
@test startswith(readline(io), "MethodInstance for ")
@test occursin(r"^ from myzeros\(::.*Type.*{T}, ::", readline(io))
readline(io) # skip location information from method printing - already tested in base
@test occursin(r"^Static Parameters$", readline(io))
@test occursin(r"^ T <: .*Integer", readline(io))
@test occursin(r"^ .*Signed.* <: R <: .*Real", readline(io))
Expand Down
3 changes: 1 addition & 2 deletions stdlib/Test/src/Test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1718,8 +1718,7 @@ Int64
julia> @code_warntype f(2)
MethodInstance for f(::Int64)
from f(a)
@ Main none:1
from f(a) @ Main none:1
Arguments
#self#::Core.Const(f)
a::Int64
Expand Down
6 changes: 3 additions & 3 deletions test/reflection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ let ex = :(a + b)
end
foo13825(::Array{T, N}, ::Array, ::Vector) where {T, N} = nothing
@test startswith(string(first(methods(foo13825))),
"foo13825(::Array{T, N}, ::Array, ::Vector) where {T, N}\n")
"foo13825(::Array{T, N}, ::Array, ::Vector) where {T, N}")

mutable struct TLayout
x::Int8
Expand Down Expand Up @@ -425,10 +425,10 @@ let li = typeof(fieldtype).name.mt.cache.func::Core.MethodInstance,
mmime = repr("text/plain", li.def)

@test lrepr == lmime == "MethodInstance for fieldtype(...)"
@test mrepr == mmime == "fieldtype(...)\n @ Core none:0"
@test mrepr == "fieldtype(...) @ Core none:0" # simple print
@test mmime == "fieldtype(...)\n @ Core none:0" # verbose print
end


# Linfo Tracing test
function tracefoo end
# Method Tracing test
Expand Down