Repository navigation
Drop Scala 2.12 and sbt 1.3 (and 0.13.x leftovers) - #10956
Conversation
|
@SethTisue as you are a Scala expert, is there something we should change here: playframework/core/play/src/main/scala/play/api/mvc/Action.scala Lines 99 to 101 in f18c239 ? |
marcospereira
left a comment
There was a problem hiding this comment.
Some minor comments, but it is LGTM, @mkurz!
This was done by @wsargent in c9d2b33 Dale found that Will wrote a longer explanation of what's going on here, in this GitHub comment: #6691 (comment) The SAM conversion rules are largely the same in 2.13 and 3 as they were in 2.12, but there are minor differences around the edges, e.g. in the interaction with overloading, but perhaps also in either areas. So it's conceivable that this is no longer needed somehow, but it's also highly plausible it is still needed and appropriate, so I'd say just leave it unless you're really interested in digging into it. |
Not interested 😆 |
Here is minimized example. class X1
class X2
class Request
class Result
trait BodyParser1[A] extends (X1 => A)
object ActionBuilder1 {
def apply[A](parser: BodyParser1[A]): X2 = ???
def apply[A](block: Request => Result): X2 = ???
}
trait BodyParser2[A] extends (X1 => A) {
self: Any => // avoid SAM
}
object ActionBuilder2 {
def apply[A](parser: BodyParser2[A]): X2 = ???
def apply[A](block: Request => Result): X2 = ???
}
object Main {
ActionBuilder1(a => ???) // "missing parameter type" error
ActionBuilder2(a => ???) // no error
}playframework/core/play/src/main/scala/play/api/mvc/Action.scala Lines 284 to 305 in 619b319 I think |
|
BTW |
|
Thanks @xuwei-k!
We can have a look at this later when actually adding Scala 3 support for Play. |
|
Thanks Renato! |
No description provided.