This only happens in Julia 1.11 and only before REPL is loaded:
method comments require __init__: Test Failed at K:\DevDocuments\Raven_Inherit\test\PkgTest1\test\runtests.jl:45
Expression: strip(string(#= K:\DevDocuments\Raven_Inherit\test\PkgTest1\test\runtests.jl:45 =# @doc(NoSubTypesOK))) == "base types can be documented"
Evaluated: "Base.Docs.DocStr(svec(\"base types can be documented\"), nothing, Dict{Symbol, Any}(:typesig => Union{}, :module => PkgTest1, :linenumber => 7, :binding => PkgTest1.NoSubTypesOK, :path => \"K:\\\\DevDocuments\\\\Raven_Inherit\\\\test\\\\PkgTest1\\\\src\\\\PkgTest1.jl\"))" == "base types can be documented"
Stacktrace:
[1] macro expansion
@ K:\.julia\juliaup\julia-1.11.6+0.x64.w64.mingw32\share\julia\stdlib\v1.11\Test\src\Test.jl:680 [inlined]
[2] macro expansion
@ K:\DevDocuments\Raven_Inherit\test\PkgTest1\test\runtests.jl:45 [inlined]
[3] macro expansion
@ K:\.julia\juliaup\julia-1.11.6+0.x64.w64.mingw32\share\julia\stdlib\v1.11\Test\src\Test.jl:1709 [inlined]
[4] top-level scope
@ K:\DevDocuments\Raven_Inherit\test\PkgTest1\test\runtests.jl:45
From the REPL @doc some_func
returns a Markdown.MD
in both 1.10 and 1.11, which can be converted via string()
. But in 1.11, before the REPL is loaded, it’s evaluating to a Base.Docs.DocStr
, where the string()
implementation looks more like repr()
. After the REPL loads, everything is normal again. I wonder if there is a package that needs to be loaded for string()
to work before the REPL?
The work around for this is:
if Int(VERSION.minor) >= 11
using REPL
end