dimsuz
02/17/2017, 12:27 PMdimsuz
02/17/2017, 12:28 PMdimsuz
02/17/2017, 12:29 PMdimsuz
02/17/2017, 12:30 PMx
to the function, ala
when(x) {
is SomeException -> do1()
isSomeComplexExceptionCond(x) -> do2()
}
but I guess this is impossible and I need to use arugment-less when
instead:
when {
x is SomeException ->
// etc
}
pakoito
02/17/2017, 12:56 PMpakoito
02/17/2017, 12:57 PMjackmiras
02/17/2017, 1:21 PMjackmiras
02/17/2017, 1:21 PMpcarrier
02/17/2017, 1:27 PMpcarrier
02/17/2017, 1:28 PMPaul Woitaschek
02/17/2017, 1:30 PMfun fail(i: Int?) = i?.let { intArrayOf(it) }
with fun fail(i: Int?) = i?.let(::intArrayOf)
which does not compileorangy
adambl4
02/17/2017, 1:40 PMorangy
Pasted image at 2017-02-17, 16:45▾
orangy
Pasted image at 2017 02 17 16 45▾
adambl4
02/17/2017, 1:47 PMit suggest explicitly▾
orangy
orangy
janvladimirmostert
02/17/2017, 6:22 PMbigkahuna
02/17/2017, 6:56 PMsreich
02/17/2017, 6:59 PMsreich
02/17/2017, 6:59 PMjanvladimirmostert
02/17/2017, 7:00 PMjanvladimirmostert
02/17/2017, 7:00 PMjanvladimirmostert
02/17/2017, 7:03 PMjanvladimirmostert
02/17/2017, 7:03 PMsreich
02/17/2017, 7:28 PMsreich
02/17/2017, 7:28 PMjanvladimirmostert
02/17/2017, 7:52 PMevanchooly
02/17/2017, 8:03 PM