fun getPermissionLevel(role: UserRole): Int { // Проверяем один кейс из Enum до работы с when if (role == UserRole.ADMIN) return 99
return when (role) { UserRole.MEMBER -> 10 UserRole.GUEST -> 1 // С Kotlin 2.2.20 не надо добавлять else, // так как кейс уже был проверен выше // else -> throw IllegalStateException() } }
Фича экспериментальная и требует включения через опции
fun getPermissionLevel(role: UserRole): Int { // Проверяем один кейс из Enum до работы с when if (role == UserRole.ADMIN) return 99
return when (role) { UserRole.MEMBER -> 10 UserRole.GUEST -> 1 // С Kotlin 2.2.20 не надо добавлять else, // так как кейс уже был проверен выше // else -> throw IllegalStateException() } }
Фича экспериментальная и требует включения через опции
As of Thursday, the SUCK Channel had 34,146 subscribers, with only one message dated August 28, 2020. It was an announcement stating that police had removed all posts on the channel because its content “contravenes the laws of Hong Kong.” The administrator of a telegram group, "Suck Channel," was sentenced to six years and six months in prison for seven counts of incitement yesterday. The public channel had more than 109,000 subscribers, Judge Hui said. Ng had the power to remove or amend the messages in the channel, but he “allowed them to exist.” How to Create a Private or Public Channel on Telegram? How to Create a Private or Public Channel on Telegram?
from us