-
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
Static forwarders are sometimes missing generic signatures #11305
Comments
What happens
There's a really long list of issues related to generic signatures. The workaround in I'm not sure what would be a good way to improve on this in 2.12.x. As a workaround, one can manually override the methods in the object
|
We could add make the compiler emit a warning when it drops the generic signature for a static forwarder, possibly under |
Just a FYI, the Alpakka Ftp connector that we noticed this regression originally in does not compile with Scala 2.13.0-M5 with the same errors. |
is that just because scala/scala#7469 didn't land until after 2.13.0-M5 was released? |
We have this issue with Scala 2.13 in Alpakka FTP, but as far as I can see there is no fix for it, yet (not in 2.12.9 nor 2.13.0). |
See also https://twitter.com/not_xuwei_k/status/1149047269766959104 by @xuwei-k
|
I assume a fix for this won't be part of 2.13.1, either. Right @lrytz ? |
I'm not planning to work on this in the near future, I'm afraid.. |
There's a regression from 2.12.7 to 2.12.8, but also some older inconsistency.
Source file:
2.12.7
When compiled with 2.12.7, we get signatures for the default methods in
A.class
:The signature of
foo
refers toA
's type parameterT
. in the signature ofbar
, the type memberU
is erased toObject
.Looking at the mixin methods in the module class
O$
, we see thatO$.bar
has a signature (the same asA.bar
), butO$.foo
doesn't have any. Not sure if that's by design, or if that's a bug. Simply using the same signature asA.foo
would be wrong, as theO$
class doesn't have a type parameterT
.Looking at the static forwarders in
O
,O.bar
has a signature,O.foo
doesn't.Abstract Class
If we change
A
to be an abstract class, the signatures forA.foo
andA.bar
are the same as before.O$
no longer has mixins. The static forwarders inO
are both without signature. I assume that's a bug?O.bar
could have the same signature asA.bar
.2.12.8
When compiling the original source (
trait A
) with 2.12.8, there's a difference: the static forwarderO.bar
is now also without signature. This is the regression compared to 2.12.7.Other than that, 2.12.8 produces the same methods/signatures as 2.12.7 (also if
A
is an abstract class).The text was updated successfully, but these errors were encountered: