https://kotlinlang.org logo
#codereview
Title
# codereview
v

voddan

04/01/2017, 1:53 PM
What's the deal with
KFunction1<@ParameterName(name = "ctx") RoutingContext, Unit>
? Is it better than
(ctx: RoutingContext) -> Unit
?
j

janvladimirmostert

04/01/2017, 2:12 PM
The second one I’ve used before, but that forces me to pass in the context as far as I can see.
Copy code
router.blockingPost2("/blah", LoginController.logout(context))
The first one was generated by IntelliJ when I typed
HomeController::default
and alt-entered it to autocomplete the signature of the extension function. I’m still reading up on what KFunction1 actually does, looks like reflection + magic.
v

voddan

04/01/2017, 4:49 PM
Their usage must be the same AFAIK
They are certainly the same on the byte code level
👍 1
4 Views