-
Notifications
You must be signed in to change notification settings - Fork 21
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
investigate javac compilation error in akka testkit #11523
Comments
Akka was built from commit c86bd49ab792ecfaaa50c8bfbb5b8677642ed965, which was green on community build run 2082 (using scala 2.13.0-pre-e7d28f4) |
So, the regression could be caused by any commit in the range scala/scala@e7d28f4...d73f85d |
Perhaps scala/scala#8037? |
The latter seems more likely, as it's a javac error, which I can't explain how it could be triggered by scala/scala#7966 |
I can reproduce locally. I'm whittling down a test case. |
package example
trait PartialFunction[-A, +B] extends Function1[A,B] { self =>
def isDefinedAt(x: A): Boolean
def compose[R](k: PartialFunction[R, A]): PartialFunction[R, B] = null
}
trait Function1[-T1, +R] extends AnyRef { self =>
def apply(v1: T1): R
def compose[A](g: Function1[A, T1]): Function1[A , R] = null
}
abstract class AbstractPartialFunction[-T1, +R] extends Function1[T1, R] with PartialFunction[T1, R] { self =>
def apply(x: T1): R = ???
}
package example;
public class Client {
class D extends example.AbstractPartialFunction<String, String> {
public boolean isDefinedAt(String s) { return false; }
};
}
This went from green to red with scala/scala#8037. But here's the interesting part: it is also red in 2.12.x. So the actual point of regression is the library changes in scala/scala@5050915 that introduces an overload of The unanswered question is: why does |
Well this is turning into a right rolicking romp.
Let's focus on
The return type should actually be We can cheat our way out of this by renaming, say, the type parameter of What can we do to protect folks from this problem? We could detect this category of unrepresentable generic signature and omit the signature and emit a warning. It's so sad that we've had to bring back generic signatures for mixin forwarders. 😢 |
Wow. |
Another possibility is for the compiler to rename the type parameter in the
mixin forwarder. We’d do this selectively to avoid the conflict, as it
shows up in type error messages.
|
Seems like scala/scala#7966 did break something in akka testkit -- haven't looked beyond copy pasting the error from https://scala-ci.typesafe.com/job/scala-2.13.x-integrate-community-build/2087/consoleText:
The text was updated successfully, but these errors were encountered: