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

Should report argument is missing instead of no implicit argument was found ? #14680

Open
He-Pin opened this issue Mar 13, 2022 · 4 comments
Open
Labels
area:annotations backlog No work planned on this by the core team for the time being. stat:needs spec stat:on hold

Comments

@He-Pin
Copy link

He-Pin commented Mar 13, 2022

Compiler version

3.1.1

Minimized code

@main def main(name:String, age:Option[Int] = Some(1)): Unit = println(name)

Output

run directly with no arguments

C:\Users\hepin\IdeaProjects\scala3Learn\src\Test.scala:2
no implicit argument of type scala.util.CommandLineParser.FromString[Option[Int]] was found for parameter fs of method parseArgument in object CommandLineParser
@main def main(name:String, age:Option[Int] = Some(1)): Unit = println(name)

Expectation

report Aguments for 'name' and 'age' is missing

@He-Pin He-Pin added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Mar 13, 2022
@smarter
Copy link
Member

smarter commented Mar 13, 2022

Likely fixed by the new main annotation being developed at #14558

@smarter smarter added area:annotations and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Mar 13, 2022
@nicolasstucki
Copy link
Contributor

Actually it will be fixed by the follow up of #14558 which will stabilize the rest of #13727.

@nicolasstucki
Copy link
Contributor

If it is a simple check, it might be worthy fixing it before we have the new version of the annotation.

@nicolasstucki
Copy link
Contributor

Actually, I completely misunderstood the issue.

We do not have an implementation of FromString for options. Not sure if we should add it as it is not clear what such a parser would expect from the string argument passed in the command line.

@hepin1989 what was the behavior you wanted to have for your arguments? What would you have passed in the command line as an age?

@nicolasstucki nicolasstucki added stat:needs spec backlog No work planned on this by the core team for the time being. and removed itype:bug labels Apr 26, 2022
@nicolasstucki nicolasstucki removed their assignment Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:annotations backlog No work planned on this by the core team for the time being. stat:needs spec stat:on hold
Projects
None yet
Development

No branches or pull requests

4 participants