Skip to content

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

Merged
merged 3 commits into from
May 12, 2017

Conversation

ennru
Copy link
Contributor

@ennru ennru commented May 2, 2017

@felixmulder Same solution regarding typer.ErrorReporting.Errors here.


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
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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?

Copy link
Member

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]

Copy link
Member

@smarter smarter May 2, 2017

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)

@felixmulder
Copy link
Contributor

Also needs rebase, then LGTM

@ennru ennru force-pushed the ennru_MethodDoesNotTakeParameters branch from 7519e6e to 9c0d0dd Compare May 11, 2017 11:52
@felixmulder
Copy link
Contributor

@dotty-bot: could you recheck please?

@dottybot
Copy link
Member

Sure thing, I got your back! ❤️

@felixmulder felixmulder merged commit ff88246 into scala:master May 12, 2017
@ennru ennru deleted the ennru_MethodDoesNotTakeParameters branch May 12, 2017 09:33
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.

4 participants