Код: Выделить всё
kotlin {
compilerOptions {
freeCompilerArgs.add("-Xwhen-guards")
}
}
< /code>
Но когда я использую «когда охранники» вроде этого < /p>
fun processNotification(notification: Notification) {
when (notification) {
is Notification.Email if notification.isHighPriority -> println("Send high-priority email")
is Notification.Email -> println("Send regular email")
is Notification.SMS if notification.isInternational -> println("Send international SMS")
is Notification.SMS -> println("Send local SMS")
else -> println("Unknown notification type")
}
}
< /code>
Android Studio по -прежнему показывает эту ошибку < /p>
The feature "when guards" is experimental and should be enabled explicitly
Подробнее здесь: https://stackoverflow.com/questions/794 ... explicitly