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

Bug on Julia master: ERROR: ArgumentError: invalid index: nothing of type Nothing when trying to use TYPEDSIGNATURES #93

Closed
DilumAluthge opened this issue Aug 2, 2020 · 0 comments

Comments

@DilumAluthge
Copy link

The bug is present on the latest registered version of DocStringExtensions, as well as the latest DocStringExtensions master.

(@v1.6) pkg> add DocStringExtensions
 Installing known registries into `~/.julia`
[ Info: LEGAL NOTICE: package operations send anonymous data about your system to https://pkg.julialang.org (your current package server), including the operating system and Julia versions you are using, and a random client UUID. Running `Pkg.telemetryinfo()` will show exactly what data is sent. See https://julialang.org/legal/data/ for more details about what this data is used for, how long it is retained, and how to opt out of sending it.
######################################################################## 100.0%
      Added registry `General` to `~/.julia/registries/General`
  Resolving package versions...
  Installed DocStringExtensions ─ v0.8.2
Updating `~/.julia/environments/v1.6/Project.toml`
  [ffbed154] + DocStringExtensions v0.8.2
Updating `~/.julia/environments/v1.6/Manifest.toml`
  [ffbed154] + DocStringExtensions v0.8.2
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [8ba89e20] + Distributed
  [b77e0a4c] + InteractiveUtils
  [76f85450] + LibGit2
  [8f399da3] + Libdl
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [44cfe95a] + Pkg
  [de0858da] + Printf
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA
  [9e88b42a] + Serialization
  [6462fe0b] + Sockets
  [8dfed614] + Test
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode

julia> import DocStringExtensions
[ Info: Precompiling DocStringExtensions [ffbed154-4ef7-542d-bbb7-c09d3a79fcae]

julia> """
       $(DocStringExtensions.TYPEDSIGNATURES)
       """
       function foo(x)
           return nothing
       end
foo

help?> foo
search: foo floor pointer_from_objref OverflowError RoundFromZero unsafe_copyto! functionloc StackOverflowError @functionloc OutOfMemoryError UndefKeywordError

ERROR: ArgumentError: invalid index: nothing of type Nothing
Stacktrace:
  [1] to_index(i::Nothing)
    @ Base ./indices.jl:297
  [2] to_index(A::Vector{DataType}, i::Nothing)
    @ Base ./indices.jl:274
  [3] to_indices(A::Vector{DataType}, inds::Tuple{Base.OneTo{Int64}}, I::Tuple{Nothing})
    @ Base ./indices.jl:329
  [4] to_indices(A::Vector{DataType}, I::Tuple{Nothing})
    @ Base ./indices.jl:322
  [5] getindex(A::Vector{DataType}, I::Nothing)
    @ Base ./abstractarray.jl:1119
  [6] format(#unused#::DocStringExtensions.TypedMethodSignatures, buf::IOBuffer, doc::Base.Docs.DocStr)
    @ DocStringExtensions ~/.julia/packages/DocStringExtensions/ojJPU/src/abbreviations.jl:389
  [7] formatdoc(buf::IOBuffer, doc::Base.Docs.DocStr, part::DocStringExtensions.TypedMethodSignatures)
    @ DocStringExtensions ~/.julia/packages/DocStringExtensions/ojJPU/src/abbreviations.jl:25
  [8] formatdoc(d::Base.Docs.DocStr)
    @ REPL ~/dev/repos/aluthge-forks/julia/usr/share/julia/stdlib/v1.6/REPL/src/docview.jl:85
  [9] parsedoc(d::Base.Docs.DocStr)
    @ REPL ~/dev/repos/aluthge-forks/julia/usr/share/julia/stdlib/v1.6/REPL/src/docview.jl:93
 [10] iterate
    @ ./generator.jl:47 [inlined]
 [11] _collect(c::Vector{Base.Docs.DocStr}, itr::Base.Generator{Vector{Base.Docs.DocStr},typeof(Base.Docs.parsedoc)}, #unused#::Base.EltypeUnknown, isz::Base.HasShape{1})
    @ Base ./array.jl:699
 [12] collect_similar
    @ ./array.jl:628 [inlined]
 [13] map
    @ ./abstractarray.jl:2225 [inlined]
 [14] doc(binding::Base.Docs.Binding, sig::Type)
    @ REPL ~/dev/repos/aluthge-forks/julia/usr/share/julia/stdlib/v1.6/REPL/src/docview.jl:187
 [15] doc(binding::Base.Docs.Binding)
    @ REPL ~/dev/repos/aluthge-forks/julia/usr/share/julia/stdlib/v1.6/REPL/src/docview.jl:155
 [16] top-level scope
    @ ~/dev/repos/aluthge-forks/julia/usr/share/julia/stdlib/v1.6/REPL/src/docview.jl:372

To edit a specific method, type the corresponding number into the REPL and press Ctrl+Q

julia> import InteractiveUtils

julia> InteractiveUtils.versioninfo()
Julia Version 1.6.0-DEV.569
Commit 84ef118f06 (2020-08-01 18:56 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin19.6.0)
  CPU: Intel(R) Core(TM) i5-4278U CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, haswell)
(@v1.6) pkg> add DocStringExtensions#master
 Installing known registries into `~/.julia`
[ Info: LEGAL NOTICE: package operations send anonymous data about your system to https://pkg.julialang.org (your current package server), including the operating system and Julia versions you are using, and a random client UUID. Running `Pkg.telemetryinfo()` will show exactly what data is sent. See https://julialang.org/legal/data/ for more details about what this data is used for, how long it is retained, and how to opt out of sending it.
######################################################################## 100.0%
      Added registry `General` to `~/.julia/registries/General`
    Cloning git-repo `https://github.com/JuliaDocs/DocStringExtensions.jl.git`
   Updating git-repo `https://github.com/JuliaDocs/DocStringExtensions.jl.git`
   Updating registry at `~/.julia/registries/General`
  Resolving package versions...
Updating `~/.julia/environments/v1.6/Project.toml`
  [ffbed154] + DocStringExtensions v0.8.2 `https://github.com/JuliaDocs/DocStringExtensions.jl.git#master`
Updating `~/.julia/environments/v1.6/Manifest.toml`
  [ffbed154] + DocStringExtensions v0.8.2 `https://github.com/JuliaDocs/DocStringExtensions.jl.git#master`
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [8ba89e20] + Distributed
  [b77e0a4c] + InteractiveUtils
  [76f85450] + LibGit2
  [8f399da3] + Libdl
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [44cfe95a] + Pkg
  [de0858da] + Printf
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA
  [9e88b42a] + Serialization
  [6462fe0b] + Sockets
  [8dfed614] + Test
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode

julia> import DocStringExtensions
[ Info: Precompiling DocStringExtensions [ffbed154-4ef7-542d-bbb7-c09d3a79fcae]

julia> """
       $(DocStringExtensions.TYPEDSIGNATURES)
       """
       function foo(x)
           return nothing
       end
foo

help?> foo
search: foo floor pointer_from_objref OverflowError RoundFromZero unsafe_copyto! functionloc StackOverflowError @functionloc OutOfMemoryError UndefKeywordError

ERROR: ArgumentError: invalid index: nothing of type Nothing
Stacktrace:
  [1] to_index(i::Nothing)
    @ Base ./indices.jl:297
  [2] to_index(A::Vector{DataType}, i::Nothing)
    @ Base ./indices.jl:274
  [3] to_indices(A::Vector{DataType}, inds::Tuple{Base.OneTo{Int64}}, I::Tuple{Nothing})
    @ Base ./indices.jl:329
  [4] to_indices(A::Vector{DataType}, I::Tuple{Nothing})
    @ Base ./indices.jl:322
  [5] getindex(A::Vector{DataType}, I::Nothing)
    @ Base ./abstractarray.jl:1119
  [6] format(#unused#::DocStringExtensions.TypedMethodSignatures, buf::IOBuffer, doc::Base.Docs.DocStr)
    @ DocStringExtensions ~/.julia/packages/DocStringExtensions/ojJPU/src/abbreviations.jl:389
  [7] formatdoc(buf::IOBuffer, doc::Base.Docs.DocStr, part::DocStringExtensions.TypedMethodSignatures)
    @ DocStringExtensions ~/.julia/packages/DocStringExtensions/ojJPU/src/abbreviations.jl:25
  [8] formatdoc(d::Base.Docs.DocStr)
    @ REPL ~/dev/repos/aluthge-forks/julia/usr/share/julia/stdlib/v1.6/REPL/src/docview.jl:85
  [9] parsedoc(d::Base.Docs.DocStr)
    @ REPL ~/dev/repos/aluthge-forks/julia/usr/share/julia/stdlib/v1.6/REPL/src/docview.jl:93
 [10] iterate
    @ ./generator.jl:47 [inlined]
 [11] _collect(c::Vector{Base.Docs.DocStr}, itr::Base.Generator{Vector{Base.Docs.DocStr},typeof(Base.Docs.parsedoc)}, #unused#::Base.EltypeUnknown, isz::Base.HasShape{1})
    @ Base ./array.jl:699
 [12] collect_similar
    @ ./array.jl:628 [inlined]
 [13] map
    @ ./abstractarray.jl:2225 [inlined]
 [14] doc(binding::Base.Docs.Binding, sig::Type)
    @ REPL ~/dev/repos/aluthge-forks/julia/usr/share/julia/stdlib/v1.6/REPL/src/docview.jl:187
 [15] doc(binding::Base.Docs.Binding)
    @ REPL ~/dev/repos/aluthge-forks/julia/usr/share/julia/stdlib/v1.6/REPL/src/docview.jl:155
 [16] top-level scope
    @ ~/dev/repos/aluthge-forks/julia/usr/share/julia/stdlib/v1.6/REPL/src/docview.jl:372

To edit a specific method, type the corresponding number into the REPL and press Ctrl+Q

julia> import InteractiveUtils

julia> InteractiveUtils.versioninfo()
Julia Version 1.6.0-DEV.569
Commit 84ef118f06 (2020-08-01 18:56 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin19.6.0)
  CPU: Intel(R) Core(TM) i5-4278U CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, haswell)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants