Skip to content

Better error message than "overloaded or recursive method needs return type" for (1)(2) #3742

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

Closed
soronpo opened this issue Jan 3, 2018 · 8 comments
Labels
area:repl area:reporting Error reporting including formatting, implicit suggestions, etc itype:enhancement prio:low

Comments

@soronpo
Copy link
Contributor

soronpo commented Jan 3, 2018

From discussion on a separate (closed) issue #3737, it became clear that at least the error message should be improved.

In dotty:

scala> 1(2) 
1 |1(2)
  |^
  |overloaded or recursive method <none> needs return type

In scalac:

scala> (1)(2)
<console>:12: error: Int(1) does not take parameters
       (1)(2)
@smarter
Copy link
Member

smarter commented Jan 3, 2018

Possibly a duplicate of #3253

@smarter
Copy link
Member

smarter commented Jan 3, 2018

Oops, I mean #2994

@propensive
Copy link
Contributor

There is an additional spurious message when attempting (1)(2) in the REPL:

Starting dotty REPL...
scala> (1)(2) 
1 |(1)(2)
  | ^
  | overloaded or recursive method <none> needs return type
1 |(1)(2)
  |^
  |value asInstanceOf does not take type parameters

@allanrenucci allanrenucci added area:repl area:reporting Error reporting including formatting, implicit suggestions, etc prio:low itype:enhancement labels Jan 4, 2018
@smarter
Copy link
Member

smarter commented Jan 4, 2018

@propensive are you using the latest Dotty master? That second message has been fixed recently.

@propensive
Copy link
Contributor

No... my attempt to build be50d2c5420cf2a1ed43b0b02f1513351093767a resulted in compile errors, so that was with 0.5.0-RC1'. I'll try building the latest master` now.

@smarter
Copy link
Member

smarter commented Jan 4, 2018

Don't forget to git submodule update --init!

@propensive
Copy link
Contributor

I was just about to say that! I missed the message before all the errors! Thanks, and sorry for the noise!

@smarter
Copy link
Member

smarter commented Mar 23, 2018

Fixed in #3750

@smarter smarter closed this as completed Mar 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:repl area:reporting Error reporting including formatting, implicit suggestions, etc itype:enhancement prio:low
Projects
None yet
Development

No branches or pull requests

4 participants