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

Rework Argument generic types to retain chaining information #31

Merged
merged 2 commits into from
Feb 8, 2023

Conversation

shadowspawn
Copy link
Contributor

@shadowspawn shadowspawn commented Feb 5, 2023

The internal Argument typing was nice and simple with chaining calls modifying a single genericArgType... but there were some permutations that were wrong (#30). Adding .choices() in #29 also does not fit into the single model.

Switch to same style as Option. Retain all the separate typing information in generics, and leave sorting it out until .addArgument() is called.


I was struggling to work out why one existing test started failing, until realised the test was wrong! The default value will never get used in this test, basically the default is wasted.

new Argument('<foo>').default(3)

@shadowspawn shadowspawn changed the base branch from main to develop February 6, 2023 01:13
Copy link
Contributor

@abetomo abetomo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shadowspawn shadowspawn added the pending release On a branch for eventual release, but not yet merged to main. label Feb 8, 2023
@shadowspawn shadowspawn merged commit b5c50d7 into develop Feb 8, 2023
@shadowspawn shadowspawn deleted the feature/argument-more-like-option branch March 1, 2023 05:54
@shadowspawn shadowspawn removed the pending release On a branch for eventual release, but not yet merged to main. label Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants