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
Compile fails with ambiguous overload when -Xexperimental is set. #238
Comments
Here's a gist containing a full example of this issue: https://gist.github.com/DylanLukes/eb775e0818c93cb1dc6e56d46f321d31 |
@DylanLukes hey, thanks for filing the issue! We're going to try to reproduce on our end and get back to you. Thanks for the complete reproduction, makes our lives a lot easier. |
My pleasure! Hope you're able to reproduce it easily. I'm on scala 2.11.8, also. The experimental features I'm using I believe were introduced in 2.11.x. |
@DylanLukes OK, so I'm getting the same behavior locally. I wonder if this is a bug in the scala compiler though, because it looks like the problem we're running into is that |
For folks following along, here is the line where Service is-a Function–https://github.com/twitter/finagle/blob/develop/finagle-core/src/main/scala/com/twitter/finagle/Service.scala#L55 |
Filed a ticket: https://issues.scala-lang.org/browse/SI-9871 so we'll see what they say. For folks trying to repro, the command I ran in the environment that @DylanLukes describes was sbt |
I'm pretty sure this has to do with the SAM sugar, which allows implicit It only happens with the -Xexperimental flag on. I solved the problem by isolating my thrift definitions in their own On Mon, Jul 25, 2016 at 7:35 PM Moses Nakamura notifications@github.com
|
Good call, it sounds like it's related to scala/scala-dev#157 –there's a bug with overloading and SAMs. Your work around sounds like a good one. I'm going to close this ticket for now, but if there's something more for us to do, please reopen it. |
I believe this may have been fixed by scala/scala#5307 or scala/scala#5357, which will be released as part of 2.12.0 final on Monday (already in RC1 and RC2). Would be interested to hear about your experience so that we can see what (if anything) we should plan to fix in 2.12.1 here. Thanks! |
@adriaanm we're blocked on 2.12.0 because scalatest is not releasing 2.12.x releases for scalatest 2.x anymore. We're trying to migrate Twitter to scalatest 3.x, but it's going to take us a long time. Sorry! |
When the
-Xexperimental
flag is set, Scrooge's generated sources fail to compile due to an ambiguous overload inFilter::andThen
introduced (presumably) by the Single-Abstract-Method (SAM) sugar.Expected behavior
The sources should compile.
Actual behavior
The following sections in the generated code fail to compile with the error messages below:
Steps to reproduce the behavior
With a
build.sbt
containing:For the following minimal Thrift definition:
Compilation yields:
The text was updated successfully, but these errors were encountered: