You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I stumbled upon a (not very critical, just inconvenient) error when using the REPL. Using the following I always get the displayed error.
julia> l = [1 => 2]
1-element Array{Pair{Int64,Int64},1}:
1 => 2
julia> (x=>y) = l[1]
Error showing value of type UnionAll:
ERROR:
SYSTEM (REPL): showing an error caused an error
ERROR:
SYSTEM (REPL): caught exception of type MethodError while trying to handle a nested exception; giving up
After that, the REPL session cannot be used anymore because subsequent calls result in the following.
julia> 1+1
┌ Error: Error in the keymap
│ exception =
│ MethodError: no method matching isspace(::Int64)
│ Closest candidates are:
│ isspace(::AbstractChar) at strings/unicode.jl:466
│ Stacktrace:
│ [1] rstrip(::typeof(isspace), ::String) at ./strings/util.jl:259
│ [2] rstrip(::String) at ./strings/util.jl:263
│ [3] add_history(::REPL.REPLHistoryProvider, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:570
│ [4] add_history(::REPL.LineEdit.PromptState) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/REPL/src/LineEdit.jl:1229
│ [5] add_history(::REPL.LineEdit.MIState) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/REPL/src/LineEdit.jl:208
│ [6] commit_line(::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/REPL/src/LineEdit.jl:1995
│ [7] (::REPL.LineEdit.var"#110#163")(::Any, ::Any, ::Vararg{Any,N} where N) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/REPL/src/LineEdit.jl:2077
│ [8] #invokelatest#1 at ./essentials.jl:710 [inlined]
│ [9] invokelatest at ./essentials.jl:709 [inlined]
│ [10] (::REPL.LineEdit.var"#22#23"{REPL.LineEdit.var"#110#163",String})(::Any, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/REPL/src/LineEdit.jl:1364
│ [11] prompt!(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/REPL/src/LineEdit.jl:2447
│ [12] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/REPL/src/LineEdit.jl:2350
│ [13] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:1143
│ [14] (::REPL.var"#38#42"{REPL.LineEditREPL,REPL.REPLBackendRef})() at ./task.jl:356
└ @ REPL.LineEdit /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/REPL/src/LineEdit.jl:2449
My Julia version:
Julia Version 1.5.0
Commit 96786e22cc (2020-08-01 23:44 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i5-4258U CPU @ 2.40GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-9.0.1 (ORCJIT, haswell)
On the current nighly build (1.6.0-DEV.1065), the result is the same, but the last error is slightly different:
What happens is that you replace the Pair constructor with nonsense and then the whole of julia comes crashing down (because it uses Pairs internally).
A more MWE would be:
julia>=>
Pair
julia>Pair(a,b) =error()
Error showing value of type UnionAll:
ERROR:
SYSTEM (REPL): showing an error caused an error
ERROR:
SYSTEM (REPL): caught exception of type ErrorException while trying to handle a nested exception; giving up
And since Pair is not a method but a constructor, you don't have to import it like with e.g.
julia>++ (generic function with 184 methods)
julia>+(a,b) =error()
ERROR: error in method definition:function Base.+ must be explicitly imported to be extended
I think this could be fixed by making =>(a,b) = Pair(a,b) instead of const => = Pair like it is now?
I stumbled upon a (not very critical, just inconvenient) error when using the REPL. Using the following I always get the displayed error.
After that, the REPL session cannot be used anymore because subsequent calls result in the following.
My Julia version:
On the current nighly build (
1.6.0-DEV.1065
), the result is the same, but the last error is slightly different:The text was updated successfully, but these errors were encountered: