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

Register default converter for Object fields #222

Closed
remkop opened this issue Oct 29, 2017 · 0 comments
Closed

Register default converter for Object fields #222

remkop opened this issue Oct 29, 2017 · 0 comments
Milestone

Comments

@remkop
Copy link
Owner

remkop commented Oct 29, 2017

If a field is defined without a type, and the compiler cannot derive the type from the context, the field's type is Object.

// example scripting class
class Params {
    @Option(names = "-o") option
}

As of picocli v2.0.1, this results in an exception picocli.CommandLine$MissingTypeConverterException: No TypeConverter registered for java.lang.Object of field private java.lang.Object picocli.groovy.CommandLineTest$Params.option.

The solution is to register a type converter for Object.class.

@remkop remkop added this to the 2.1.0 milestone Oct 29, 2017
@remkop remkop closed this as completed in e1c45d9 Oct 29, 2017
@remkop remkop modified the milestones: 2.1.0, 2.0.2 Nov 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant