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

Incorrect error message for methods taking tuples as arguments #5067

Closed
scabug opened this issue Oct 9, 2011 · 3 comments
Closed

Incorrect error message for methods taking tuples as arguments #5067

scabug opened this issue Oct 9, 2011 · 3 comments
Assignees

Comments

@scabug
Copy link

@scabug scabug commented Oct 9, 2011

Given the following (incorrect) class:

class Foo extends Function2[Int, Int, Int] {
  def apply(x: Int, y: Int) = x + y
  override def tupled: (Int, Int) => Int = super.tupled
}

The 2.9.1 generates the following incorrect and confusing error message:

[error] /Users/paul/scala/foo/src/main/scala/Foo.scala:5: type mismatch;
[error]  found   : (Int, Int) => Int
[error]  required: (Int, Int) => Int
[error]   override def tupled: (Int, Int) => Int = super.tupled
[error]                                                  ^

This is a regression from 2.9.0, which generates:

[error] /Users/paul/scala/foo/src/main/scala/Foo.scala:5: type mismatch;
[error]  found   : ((Int, Int)) => Int
[error]  required: (Int, Int) => Int
[error]   override def tupled: (Int, Int) => Int = super.tupled
[error]                                                  ^
[error] one error found

An SBT project that demonstrates this issue is checked into GitHub. See the correct error message with ++ 2.9.0 compile and the incorrect one with ++ 2.9.1 compile.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Oct 9, 2011

Imported From: https://issues.scala-lang.org/browse/SI-5067?orig=1
Reporter: @paulbutcher
Affected Versions: 2.9.1

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Oct 9, 2011

Commit Message Bot (anonymous) said:
(extempore in r25808) Fix for error printing regression.

One's devotion to aesthetics must not be allowed to trump one's
commitment to clearly delineated tuplehood. Closes #5067, no review.

@scabug scabug closed this Oct 9, 2011
@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Oct 9, 2011

@paulbutcher said:
Many thanks for the rapid turnaround, Paul! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.