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

MethodError: no method matching is_syntactic_operator #39156

Closed
antimon2 opened this issue Jan 9, 2021 · 1 comment
Closed

MethodError: no method matching is_syntactic_operator #39156

antimon2 opened this issue Jan 9, 2021 · 1 comment

Comments

@antimon2
Copy link

antimon2 commented Jan 9, 2021

In Julia1.6-beta1, the following error occurs if showing an Expr containing macro calls with symbolic characters.

julia-1.6.0-beta1> :(@..{1,2,..})
:(#= REPL[1]:1 =# @Error showing value of type Expr:
ERROR: MethodError: no method matching is_syntactic_operator(::String)
Closest candidates are:
  is_syntactic_operator(::Symbol) at show.jl:1221
Stacktrace:
  [1] is_valid_identifier
    @ ./show.jl:1399 [inlined]
  [2] show_sym(io::IOContext{Base.TTY}, sym::String; allow_macroname::Bool)
    @ Base ./show.jl:1438
  [3] show_sym
    @ ./show.jl:1438 [inlined]
  [4] show_sym(io::IOContext{Base.TTY}, sym::Symbol; allow_macroname::Bool)
    @ Base ./show.jl:1442
  [5] show_unquoted(io::IOContext{Base.TTY}, ex::Expr, indent::Int64, prec::Int64, quote_level::Int64)
    @ Base ./show.jl:1942
  [6] show_list(io::IOContext{Base.TTY}, items::Vector{Any}, sep::Char, indent::Int64, prec::Int64, quote_level::Int64, enclose_operators::Bool, kw::Bool)
    @ Base ./show.jl:1385
  [7] show_list
    @ ./show.jl:1366 [inlined]
  [8] show_unquoted(io::IOContext{Base.TTY}, ex::Expr, indent::Int64, prec::Int64, quote_level::Int64)
    @ Base ./show.jl:1935
  [9] show_unquoted_quote_expr(io::IOContext{Base.TTY}, value::Any, indent::Int64, prec::Int64, quote_level::Int64)
    @ Base ./show.jl:1515
 [10] show
    @ ./show.jl:1134 [inlined]
 [11] show(io::IOContext{Base.TTY}, #unused#::MIME{Symbol("text/plain")}, x::Expr)
    @ Base.Multimedia ./multimedia.jl:47
 [12] (::REPL.var"#38#39"{REPL.REPLDisplay{REPL.LineEditREPL}, MIME{Symbol("text/plain")}, Base.RefValue{Any}})(io::Any)
    @ REPL /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:220
 [13] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
    @ REPL /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:462
 [14] display(d::REPL.REPLDisplay, mime::MIME{Symbol("text/plain")}, x::Any)
    @ REPL /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:213
 [15] display(d::REPL.REPLDisplay, x::Any)
    @ REPL /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:225
 [16] display(x::Any)
    @ Base.Multimedia ./multimedia.jl:328
 [17] #invokelatest#2
    @ ./essentials.jl:707 [inlined]
 [18] invokelatest
    @ ./essentials.jl:706 [inlined]
 [19] print_response(errio::IO, response::Any, show_value::Bool, have_color::Bool, specialdisplay::Union{Nothing, AbstractDisplay})
    @ REPL /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:247
 [20] (::REPL.var"#40#41"{REPL.LineEditREPL, Pair{Any, Bool}, Bool, Bool})(io::Any)
    @ REPL /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:231
 [21] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
    @ REPL /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:462
 [22] print_response(repl::REPL.AbstractREPL, response::Any, show_value::Bool, have_color::Bool)
    @ REPL /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:229
 [23] (::REPL.var"#do_respond#61"{Bool, Bool, REPL.var"#72#82"{REPL.LineEditREPL, REPL.REPLHistoryProvider}, REPL.LineEditREPL, REPL.LineEdit.Prompt})(s::REPL.LineEdit.MIState, buf::Any, ok::Bool)
    @ REPL /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:798
 [24] #invokelatest#2
    @ ./essentials.jl:707 [inlined]
 [25] invokelatest
    @ ./essentials.jl:706 [inlined]
 [26] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
    @ REPL.LineEdit /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/LineEdit.jl:2441
 [27] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
    @ REPL /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:1126
 [28] (::REPL.var"#44#49"{REPL.LineEditREPL, REPL.REPLBackendRef})()
    @ REPL ./task.jl:406

As a comment on #38830 I reported, I see that applying a patch merged into master solves this problem.

(↓ with my local build)

julia-1.6.0-DEV.1780> :(@..{1,2,..})
:(#= REPL[1]:1 =# @.. {1, 2, ..})

(the above is same behavior in Julia v1.5.x and v1.7-DEV).

@antimon2
Copy link
Author

antimon2 commented Feb 2, 2021

Close this issue because of PR #39160 merged into release-1.6 branch.
It seems to be incorporated when beta2 or rc1 is released.
I have confirmed the behavior with my local build.

julia-1.6.0-beta1.81> :(@..{1,2,..})
:(#= REPL[1]:1 =# @.. {1, 2, ..})

@antimon2 antimon2 closed this as completed Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant