You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When preparing twitter util for cross-publishing to scala 2.12, we found that a method that we had previously used without having to specify types now required type annotations.
@som-snytt said (edited on May 29, 2016 6:39:55 PM UTC):
Updatable is a SAM type. You'll see the new behavior in 2.11 under -Xexperimental. You'll see the old behavior under -Xsource:2.11.
When each A.apply takes a function parameter, then the args are typed with no expected type during overload resolution.
In the working case, the shape of the args selects only the alternative that takes a function.
This is discussed in the announcement under breaking changes.
When preparing twitter util for cross-publishing to scala 2.12, we found that a method that we had previously used without having to specify types now required type annotations.
The diff is here:
https://github.com/twitter/util/pull/163/files
The method is Witness#apply, which is overloaded.
https://github.com/twitter/util/blob/develop/util-core/src/main/scala/com/twitter/util/Event.scala#L416-L442
We did a little more thinking about what might be going on here:
twitter/util#162 (comment)
We were able to construct a reproduction case which succeeds on 2.11, but fails on 2.12.
The output on 2.12 is:
Under 2.11, it compiles successfully.
The text was updated successfully, but these errors were encountered: