We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Vararg
Describe the bug A CLI function of the form:
@main foo(xs::Vararg{String}) = foreach(println, xs)
Errors with ERROR: LoadError: TypeError: in <:, expected Type, got Vararg{String}. See the full stacktrace at the bottom of this post.
ERROR: LoadError: TypeError: in <:, expected Type, got Vararg{String}
Version of the package:
This does not happen on earlier Julia versions
To Reproduce Execute the following script
using Comonicon @main foo(xs::Vararg{String}) = foreach(println, xs)
This presumably happens because Vararg{String} isa Type returns false on Julia 1.7 and later.
Vararg{String} isa Type
false
Full stack trace:
ERROR: LoadError: TypeError: in <:, expected Type, got Vararg{String} Stacktrace: [1] ignore_type(type::Core.TypeofVararg) @ Comonicon.AST ~/.julia/packages/Comonicon/AXDxW/src/ast/printing.jl:2 [2] print_cmd(io::IOBuffer, arg::Comonicon.AST.Argument, t::Comonicon.AST.Terminal) @ Comonicon.AST ~/.julia/packages/Comonicon/AXDxW/src/ast/printing.jl:95 [3] print_signature @ Comonicon.AST ~/.julia/packages/Comonicon/AXDxW/src/ast/printing.jl:179 [inlined] [4] print_with_brief(f::typeof(Comonicon.AST.print_signature), io::IOContext{IOBuffer}, cmd::Comonicon.AST.Argument, t::Comonicon.AST.Terminal) @ Comonicon.AST ~/.julia/packages/Comonicon/AXDxW/src/ast/printing.jl:268 [5] print_sig_brief @ Comonicon.AST ~/.julia/packages/Comonicon/AXDxW/src/ast/printing.jl:259 [inlined] [6] print_body(io::IOContext{IOBuffer}, cmd::Comonicon.AST.LeafCommand, t::Comonicon.AST.Terminal) @ Comonicon.AST ~/.julia/packages/Comonicon/AXDxW/src/ast/printing.jl:225 [7] print_cmd(io::IOContext{IOBuffer}, cmd::Comonicon.AST.LeafCommand, t::Comonicon.AST.Terminal) @ Comonicon.AST ~/.julia/packages/Comonicon/AXDxW/src/ast/printing.jl:152 [8] print_cmd(io::IOContext{IOBuffer}, cmd::Comonicon.AST.LeafCommand) @ Comonicon.AST ~/.julia/packages/Comonicon/AXDxW/src/ast/printing.jl:86 [9] _sprint(f::Function, args::Comonicon.AST.LeafCommand; color::Bool, displaysize::Tuple{Int64, Int64}) @ Comonicon ~/.julia/packages/Comonicon/AXDxW/src/compat.jl:10 [10] _sprint @ Comonicon ~/.julia/packages/Comonicon/AXDxW/src/compat.jl:7 [inlined] [11] #help_str#1 @ Comonicon.JuliaExpr ~/.julia/packages/Comonicon/AXDxW/src/codegen/julia.jl:10 [inlined] [12] help_str @ Comonicon.JuliaExpr ~/.julia/packages/Comonicon/AXDxW/src/codegen/julia.jl:9 [inlined] [13] print_help_str(x::Comonicon.AST.LeafCommand, ctx::Comonicon.JuliaExpr.EmitContext) @ Comonicon.JuliaExpr ~/.julia/packages/Comonicon/AXDxW/src/codegen/julia.jl:33 [14] emit_help(x::Comonicon.AST.LeafCommand, ctx::Comonicon.JuliaExpr.EmitContext, ptr::Int64; color::Bool) @ Comonicon.JuliaExpr ~/.julia/packages/Comonicon/AXDxW/src/codegen/julia.jl:40 [15] emit_help @ Comonicon.JuliaExpr ~/.julia/packages/Comonicon/AXDxW/src/codegen/julia.jl:40 [inlined] [16] emit_body(cmd::Comonicon.AST.LeafCommand, ctx::Comonicon.JuliaExpr.EmitContext, ptr::Int64) @ Comonicon.JuliaExpr ~/.julia/packages/Comonicon/AXDxW/src/codegen/julia.jl:150 [17] emit_body(cmd::Comonicon.AST.NodeCommand, ctx::Comonicon.JuliaExpr.EmitContext, ptr::Int64) @ Comonicon.JuliaExpr ~/.julia/packages/Comonicon/AXDxW/src/codegen/julia.jl:133 [18] emit(cmd::Comonicon.AST.Entry, configs::Comonicon.JuliaExpr.Configs, ptr::Int64) @ Comonicon.JuliaExpr ~/.julia/packages/Comonicon/AXDxW/src/codegen/julia.jl:86 [19] top-level scope @ ~/.julia/packages/Comonicon/AXDxW/src/frontend/cast.jl:449 [20] include @ Base ./Base.jl:489 [inlined] [21] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::String) @ Base ./loading.jl:2216 [22] top-level scope @ stdin:3
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Describe the bug
A CLI function of the form:
Errors with
ERROR: LoadError: TypeError: in <:, expected Type, got Vararg{String}
. See the full stacktrace at the bottom of this post.Version of the package:
This does not happen on earlier Julia versions
To Reproduce
Execute the following script
This presumably happens because
Vararg{String} isa Type
returnsfalse
on Julia 1.7 and later.Full stack trace:
The text was updated successfully, but these errors were encountered: