[BUG] demo not working in julia 1.6
xgdgsc opened this issue · comments
Describe the bug
demo at https://comonicon.org/stable/project/
module Demo
using Comonicon
@cast mycmd1(arg; option="Sam") = println("cmd1: arg=", arg, "option=", option)
@cast mycmd2(arg; option="Sam") = println("cmd2: arg=", arg, "option=", option)
"""
a module
"""
module Cmd3
using Comonicon
@cast mycmd4(arg) = println("cmd4: arg=", arg)
end # module
@cast Cmd3
"""
my demo Comonicon CLI project.
"""
@main
end # module
only works in julia 1.7
Version of the package:
julia> Pkg.status()
Status ~/Documents/tmp/Project.toml
[863f3e99] Comonicon v0.12.8
To Reproduce
Steps to reproduce the behavior:
- Go to julia REPL
- paste Demo code
Expected behavior
work
gives errors:
ERROR: MethodError: no method matching IOContext(::IOBuffer, ::Tuple{Pair{Symbol, Bool}, Pair{Symbol, Tuple{Int64, Int64}}})
Closest candidates are:
IOContext(::IO) at show.jl:245
IOContext(::IO, ::Base.ImmutableDict) at show.jl:238
IOContext(::IO, ::Pair) at show.jl:247
...
Stacktrace:
[1] sprint(f::Function, args::Markdown.MD; context::Tuple{Pair{Symbol, Bool}, Pair{Symbol, Tuple{Int64, Int64}}}, sizehint::Int64)
@ Base ./strings/io.jl:103
[2] md_to_string(md::Markdown.MD)
@ Comonicon ~/.julia/packages/Comonicon/kRHtu/src/frontend/markdown.jl:176
[3] read_description(md::Markdown.MD)
@ Comonicon ~/.julia/packages/Comonicon/kRHtu/src/frontend/markdown.jl:105
[4] split_docstring(m::Module)
@ Comonicon ~/.julia/packages/Comonicon/kRHtu/src/frontend/markdown.jl:18
[5] cast(m::Module, name::String, line::LineNumberNode)
@ Comonicon ~/.julia/packages/Comonicon/kRHtu/src/frontend/cast.jl:490
[6] top-level scope
@ ~/.julia/packages/Comonicon/kRHtu/src/frontend/cast.jl:364
in 1.6. In 1.7 it works.