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

cast_args cant handle zero length args #135

Closed
SamRodkey opened this issue Jun 4, 2021 · 3 comments
Closed

cast_args cant handle zero length args #135

SamRodkey opened this issue Jun 4, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@SamRodkey
Copy link
Contributor

@Roger-luo

When upgrading to 0.11 from 0.10.2, I had a precompilation error which appears to be due to the fact that cast_args method doesn't seem to be able to handle a zero-length args input gracefully. I have a couple commands that I've casted that have zero arguments and so it didn't like these at all.

Snapshot of stacktrace:

ERROR: LoadError: BoundsError: attempt to access 0-element Vector{ComoniconTypes.Argument} at index [0]
Stacktrace:
  [1] getindex
    @ .\array.jl:801 [inlined]
  [2] last
    @ .\abstractarray.jl:437 [inlined]
  [3] cast_args
    @ ~\.julia\packages\Comonicon\qwttE\src\cast.jl:297 [inlined]
  [4] cast(f::Function, name::String, args::Vector{Comonicon.JLArgument}, options::Vector{Comonicon.JLOption}, flags::Vector{Comonicon.JLFlag}, line::LineNumberNode)
    @ Comonicon ~\.julia\packages\Comonicon\qwttE\src\cast.jl:278

I've got a PR that fixes this on my end that I will submit for your approval.

@Roger-luo Roger-luo added the bug Something isn't working label Jun 4, 2021
@Roger-luo
Copy link
Collaborator

Thanks a lot! and sorry for the breaking, I did a rewrite of the package recently (and it's not yet fully finished) to split out things into seperate packages so that we can use them for GUI generator in the future. Feel free to open the PR, and I'll review it

@SamRodkey
Copy link
Contributor Author

Yeah, I've been enjoying the package alot and used it to try and convince a colleague to switch to julia by giving him a CLI to run some jobs quickly. Unfortunately, this broke when he tried to upgrade his install. lol.

Let me know when this gets released/revbumped so I can tell my colleague its safe to upgrade again. Thanks or all your hard work, and I'd love to help with the package if you think theres room for a newb.

@Roger-luo
Copy link
Collaborator

what's left is mainly about rewriting the IonCLI using the new version, and fix up the binary building issues appears during the rewrite of IonCLI. I haven't got time to do this since I need to work on our quantum compiler project a bit. but I'll get back to this soon, since the life without IonCLI is a pain for me ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants