All streams
Search
Write a publication
Pull to refresh
0
0

User

Send message

val a = b.let { nonNullable -> nonNullable } ?: "Equal to 'null' or not set"

Если мы хотим получить nonNullable внутри let, нужно использовать safe call operator. В противном случае у нас будет nullable)

Правильно так:

val a = b?.let { nonNullable -> nonNullable } ?: "Equal to 'null' or not set"

Information

Rating
Does not participate
Registered
Activity