Closed
Description
julia> tryparse(Int, "") === nothing
true
julia> tryparse(Int, " ") === nothing
true
julia> tryparse(Bool, "") === nothing
true
julia> tryparse(Bool, " ")
ERROR: BoundsError: attempt to access 1-codeunit String at index [2]
Stacktrace:
[1] checkbounds
@ ./strings/basic.jl:216 [inlined]
[2] codeunit
@ ./strings/string.jl:102 [inlined]
[3] getindex
@ ./strings/string.jl:223 [inlined]
[4] tryparse_internal(#unused#::Type{Bool}, sbuff::String, startpos::Int64, endpos::Int64, base::Int64, raise::Bool)
@ Base ./parse.jl:197
[5] #tryparse#456
@ ./parse.jl:237 [inlined]
[6] tryparse(::Type{Bool}, s::String)
@ Base ./parse.jl:237
[7] top-level scope
@ REPL[4]:1