-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Moved Method Does Not Take (More) Parameters error to case class #2357
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
Moved Method Does Not Take (More) Parameters error to case class #2357
Conversation
|
||
val explanation = | ||
hl"""|You have specified more parameter lists as defined in the method definition(s). | ||
|In case ${err.refStr(methPartType)} is defined without parenthesis, you may |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to only display this when methPartType
is actually defined without parenthesis. I think methPartType.isInstanceOf[ExprType]
should check for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, was looking around for an easy enough check to do just that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smarter I find a TermRefWithSignature
in my samples, do I need to test for just that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try methPartType.widenSingleton.isInstanceOf[ExprType]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(A TermRef
might not always be a reference to a method with no arguments, so we widen it to its underlying type and check that)
Also needs rebase, then LGTM |
7519e6e
to
9c0d0dd
Compare
@dotty-bot: could you recheck please? |
Sure thing, I got your back! ❤️ |
@felixmulder Same solution regarding
typer.ErrorReporting.Errors
here.