Paul Woitaschek
07/04/2019, 7:23 PMInvocationKind.AT_MOST_ONCE
? Use case as in: What is it good for, not how to use it.Daniel
07/04/2019, 9:38 PMIntrinsics.checkParameterIsNotNull(..., "....");
but not the returned value.
The first question would be, how can this happen that a returned value is null even when its defined as not null? Unfortunately we got a data class for a backend response wrong: We set a property of the data class as non null, but it was nullable in the backend. So Gson was putting null in it.
The said property was then propagated through different methods via return
and way higher up something crashed. If there were a Intrinsic check in place in every method we would have had an easier time debugging the issue.
There is most definitely a reason for why the kotlin team decided against it and I am curious for it! 🙂Andrew Gazelka
07/04/2019, 10:34 PMNir
07/04/2019, 10:57 PMkschlesselmann
07/05/2019, 8:10 AMthana
07/05/2019, 8:13 AMmike_shysh
07/05/2019, 11:09 AMmike_shysh
07/05/2019, 11:11 AMbod
07/05/2019, 12:13 PMmc
07/05/2019, 1:07 PMfun <R> (suspend () -> R).fallbackTo(block: () -> R) : suspend () -> R = {
try {
this()
} catch (e: Exception) {
block()
}
}
fun <T1, R> (suspend (T1) -> R).fallbackTo(block: (T1) -> R) : suspend (T1) -> R = { t1 ->
try {
this(t1)
} catch (e: Exception) {
block(t1)
}
}
fun <T1, T2, R> (suspend (T1, T2) -> R).fallbackTo(block: (T1, T2) -> R) : suspend (T1, T2) -> R = { t1, t2 ->
try {
this(t1, t2)
} catch (e: Exception) {
block(t1, t2)
}
}
igor.wojda
07/05/2019, 1:31 PM"apiBaseUrl" -> "api_base_url"
Nir
07/05/2019, 2:34 PMam414
07/05/2019, 2:34 PMimport com.john.movie.util.Constants.Companion.NOW_PLAYING_MOVIES
import com.john.movie.util.Constants.Companion.POPULAR_MOVIES
import com.john.movie.util.Constants.Companion.TOP_RATED_MOVIES
import com.john.movie.util.Constants.Companion.UP_COMING_MOVIES
this not working
import com.john.movie.util.Constants.Companion.*
Dima Avdeev
07/05/2019, 5:31 PMJoshK
07/05/2019, 7:27 PMval (first, second, third) = "first,second,third".split(",")
?william
07/05/2019, 9:04 PMRegex("{}")
shows up with the errors Dangling metacharacter
on both the opening and closing bracketNir
07/05/2019, 11:46 PMNir
07/05/2019, 11:46 PMNir
07/05/2019, 11:47 PMthiagoretondar
07/06/2019, 1:47 AMdata class
instances? One by one?igor.wojda
07/06/2019, 1:43 PMputData(property: KProperty1<out Any?, Any?>, value: Any?) { }
Is there any way to check is property
is of the same type as value
?halirutan
07/07/2019, 12:18 AMValV
07/07/2019, 1:37 AMNir
07/07/2019, 3:38 PMinline fun <T> T.add(f: T.() -> T) : T {
return this.f()
}
Nir
07/07/2019, 4:06 PMinterface MyInterface {
}
data class User(val x: String, val y: Int) : MyInterface
inline operator fun <T : MyInterface> T.plus(f: T.() -> T) : T {
return this.f()
}
fun main() {
var n = User(x = "hello", y = 5)
n += { copy(y = 7) }
}
SrSouza
07/07/2019, 11:08 PMKulwinder Singh
07/08/2019, 3:20 AMMohamed Ibrahim
07/08/2019, 9:16 AMwhen
with ignorecase when it comes to comparing stringsFlorian
07/08/2019, 10:00 AM1.plus(2)
. Is there also a form like this for in
when it uses iterator
(not contains
)?Florian
07/08/2019, 11:52 AM