5/18/2023 0 Comments Kotlin not null check![]() Thats fine because you might not need the check. It should be public inline fun CharSequence.isNotEmpty (): Boolean this null & length > 0 This would be more. Today I came across a piece of code that looked like this: fun printAll(vararg names: String?) !Īfter decompiling Kotlin’s bytecode I saw that no matter what type I use ( String? or String) the java code was the same: public static final void String. Kotlin extension functions with null checks Ask Question Asked 4 years, 9 months ago Modified 4 years, 9 months ago Viewed 1k times 3 Kotlin defines extension functions like also but they are not null checked. Logically isNotEmpty is definitely not null.
0 Comments
Leave a Reply. |