diesieben07
08/14/2017, 10:43 AMgetBody
will be exposed as a property (like a field in java), so just someObj.body
.qwert_ukg
08/14/2017, 10:44 AMqwert_ukg
08/14/2017, 10:44 AMqwert_ukg
08/14/2017, 10:48 AMval r = Webb.create().post(url)
.asJsonObject()
.body(JSONObject())
.body
diesieben07
08/14/2017, 10:48 AMgetBody()
, too, but IntelliJ will emit a warning for that.dragas
08/14/2017, 10:50 AMgetBody
since it has overloaded calls.qwert_ukg
08/14/2017, 10:50 AMbody(JSONObject())
Error:(57, 18) Kotlin: Expression 'body' of type 'JSONObject!' cannot be invoked as a function. The function 'invoke()' is not found
dragas
08/14/2017, 10:50 AMgetBody(JsonObject()))
qwert_ukg
08/14/2017, 10:51 AMdragas
08/14/2017, 10:51 AMqwert_ukg
08/14/2017, 10:51 AMqwert_ukg
08/14/2017, 10:51 AMqwert_ukg
08/14/2017, 10:51 AMqwert_ukg
08/14/2017, 10:52 AMqwert_ukg
08/14/2017, 10:52 AMuser
08/14/2017, 10:59 AMhttps://kotlinlang.slack.com/files/U56PJT5FY/F6N9F6YR3/pasted_image_at_2017_08_14_12_39_pm.png▾
diesieben07
08/14/2017, 11:01 AMasJsonObject
returns a Response<JsonObject>
, which does not have a body(arg)
method.qwert_ukg
08/14/2017, 11:02 AMsupaham
08/14/2017, 4:59 PMtrevjones
08/14/2017, 5:51 PMleonardootto
08/14/2017, 6:16 PMjw
08/14/2017, 6:18 PMleonardootto
08/14/2017, 6:24 PMRuckus
08/14/2017, 8:08 PMclass Thing {
var debugger: ((String) -> Unit)? = null
}
val receiver = StringBuilder()
val thing = Thing()
thing.debugger = receiver::appendln // Fails
The marked line fails since it cannot figure out which overload of println
to use. It doesn't work if I change debugger
to accept CharSequence
or CharSequence?
either.
Is this a bug or expected behaviour?Ruckus
08/14/2017, 8:18 PMthing.debugger = { receiver.appendln(it) }
has an intention that converts to the code I posted, but I want to make sure.stantronic
08/14/2017, 8:21 PMstantronic
08/14/2017, 8:22 PMstantronic
08/14/2017, 8:22 PMstantronic
08/14/2017, 8:24 PM