bennofs
02/13/2018, 10:14 PMwith
(not modifying the implementation of the Weird
class) Not that I'd actually write this codeRuckus
02/13/2018, 10:20 PMbennofs
02/13/2018, 10:21 PMwithContext
in this example?Ruckus
02/13/2018, 10:23 PMwithContext()
has a single receiver, but is defined within the scope of Weird
, which creates another implicit receiver when you're not in the scope.bennofs
02/13/2018, 10:24 PMwithContext
has two receivers, one implicit and one explicit?Ruckus
02/13/2018, 10:24 PMthis : Weird
, and with
is an easy way to do that.x.apply { Weird("this-argument").withContext() }
or anything else that creates such a scope.bennofs
02/13/2018, 10:29 PMWeird::foo
to get a function, but this doesn't work for withContext
Ruckus
02/13/2018, 10:30 PMwith
šbennofs
02/13/2018, 10:30 PMWeird::foo
only works for functions defined with =
it seems</strike>Ruckus
02/13/2018, 10:31 PMWeird::foo
will work with any function (not just expression functions), so long as it doesn't violate some constraints like the multiple receivers.bennofs
02/13/2018, 10:33 PM@lparams
necessary in this code: https://github.com/Kotlin/anko/blob/84e3838327011996aee24fb25f682fc7c1f7779e/anko/library/generated/sdk25/src/Layouts.kt#L95-L103 or was it just placed there for clarity?Ruckus
02/13/2018, 10:39 PMthis : T
and not the this : _AppWidgetHostView
.bennofs
02/13/2018, 10:40 PM