{"id":410945,"date":"2024-06-29T21:40:59","date_gmt":"2024-06-29T21:40:59","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=410945"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=410945","title":{"rendered":"<span>JetBrains \u0432\u044b\u043f\u0443\u0441\u0442\u0438\u043b\u0430 Kotlin 1.8.20<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>JetBrains <a href=\"https:\/\/blog.jetbrains.com\/kotlin\/2023\/04\/kotlin-1-8-20-released\/\" rel=\"noopener noreferrer nofollow\">\u0432\u044b\u043f\u0443\u0441\u0442\u0438\u043b\u0430<\/a> \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u044f\u0437\u044b\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Kotlin 1.8.20. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0451\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 Kotlin K2 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e \u043a\u043e\u0434\u0430 \u0432 WebAssembly.<\/p>\n<p>\u0412 \u0432\u0435\u0440\u0441\u0438\u0438 Kotlin 1.8.20 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 Kotlin K2 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0430\u043b\u044c\u0444\u0430-\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 JS IR \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 Kotlin 2.0. \u0414\u043b\u044f \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 K2 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u044f\u0437\u044b\u043a\u043e\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043e\u043f\u0446\u0438\u0435\u0439 <code>-language-version 2.0<\/code>.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u044d\u0442\u043e \u0432 \u0444\u0430\u0439\u043b\u0435 <code>build.gradle(.kts)<\/code>:<\/p>\n<pre><code>kotlin {    sourceSets.all {        languageSettings {            languageVersion = \"2.0\"        }    } }<\/code><\/pre>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 Kotlin \u043f\u0440\u043e\u0441\u0438\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u0443\u0447\u0430\u0441\u0442\u0438\u0435 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0421\u0432\u043e\u0438 \u043e\u0442\u0437\u044b\u0432\u044b \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u043a\u0430\u043d\u0430\u043b\u0435 Slack. \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043e\u043f\u0446\u0438\u044e \u00ab\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f\u00bb, \u0447\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u0430\u043c \u0438\u0437 JetBrains \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 K2.<\/p>\n<p>\u0412 \u0432\u0435\u0440\u0441\u0438\u0438 Kotlin 1.8.20 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043d\u043e\u0432\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438\u0437 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 Enum. \u0420\u0430\u043d\u044c\u0448\u0435 \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u043c\u0435\u0442\u043e\u0434 <code>values()<\/code>, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0432\u0448\u0438\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f. \u0422\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043b \u043a \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u0432 Java \u0438 Kotlin, \u0430 \u043c\u043d\u043e\u0433\u0438\u0435 API \u0442\u0440\u0435\u0431\u0443\u044e\u0442, \u0447\u0442\u043e\u0431\u044b \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0431\u044b\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c\u0438.<\/p>\n<p>\u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432 \u043a\u043b\u0430\u0441\u0441\u0430\u0445 Enum \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>entries<\/code>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442. \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u043e <code>values()<\/code>, \u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u043f\u043e\u043a\u0430 \u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438:<\/p>\n<pre><code>enum class Color(val colorName: String, val rgb: String) {    RED(\"Red\", \"#FF0000\"),    ORANGE(\"Orange\", \"#FF7F00\"),    YELLOW(\"Yellow\", \"#FFFF00\") }   @OptIn(ExperimentalStdlibApi::class) fun findByRgb(rgb: String): Color? = Color.entries.find { it.rgb == rgb }<\/code><\/pre>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 <code>entries<\/code> \u043f\u043e\u043a\u0430 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0438 \u0435\u0451 \u043d\u0430\u0434\u043e \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e.\u00a0<\/p>\n<p>\u0412 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u043d\u0430 Kotlin \u0432 WebAssembly. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 JetBrains \u0441\u0447\u0438\u0442\u0430\u044e\u0442, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0432\u044b\u0441\u043e\u043a\u043e\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u0434 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435.<\/p>\n<p>\u0414\u043b\u044f \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Kotlin\/Wasm \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0444\u0430\u0439\u043b <code>build.gradle(.kts)<\/code>:<\/p>\n<pre><code>plugins {     kotlin(\"multiplatform\") version \"1.8.20-RC2\" }  kotlin {     wasm {         binaries.executable()         browser {         }     }     sourceSets {         val commonMain by getting         val commonTest by getting {             dependencies {                 implementation(kotlin(\"test\"))             }         }         val wasmMain by getting         val wasmTest by getting     } }<\/code><\/pre>\n<p>\u0412\u043c\u0435\u0441\u0442\u0435 \u0441 \u044d\u0442\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0446\u0435\u043b\u0435\u0432\u0443\u044e \u0441\u0440\u0435\u0434\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430. \u0412 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u043a \u0432\u044b\u043f\u0443\u0441\u043a\u0443 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0434\u043b\u044f Chrome, Firefox \u0438 Edge.<\/p>\n<p>\u0421 \u043f\u043e\u043b\u043d\u044b\u043c \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0432 <a href=\"https:\/\/kotlinlang.org\/docs\/whatsnew1820.html\" rel=\"noopener noreferrer nofollow\">\u0431\u043b\u043e\u0433\u0435<\/a> JetBrains \u0438\u043b\u0438 \u0432 <a href=\"https:\/\/github.com\/JetBrains\/kotlin\/releases\/tag\/v1.8.20\" rel=\"noopener noreferrer nofollow\">\u0437\u0430\u043f\u0438\u0441\u044f\u0445<\/a> \u043a \u0440\u0435\u043b\u0438\u0437\u0443 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 GitHub. \u0412\u043c\u0435\u0441\u0442\u0435 \u0441 Kotlin \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f \u043e\u0431\u043d\u043e\u0432\u0438\u043b\u0430 \u00a0<a href=\"https:\/\/habr.com\/ru\/news\/t\/726450\/\" rel=\"noopener noreferrer nofollow\">PyCharm<\/a>, <a href=\"https:\/\/habr.com\/ru\/news\/t\/726510\/\" rel=\"noopener noreferrer nofollow\">IntelliJ IDEA<\/a>, <a href=\"https:\/\/habr.com\/ru\/news\/t\/726542\/\" rel=\"noopener noreferrer nofollow\">WebStorm<\/a>, <a href=\"https:\/\/habr.com\/ru\/news\/t\/726560\/\" rel=\"noopener noreferrer nofollow\">Aqua IDE<\/a>, <a href=\"https:\/\/habr.com\/ru\/news\/726884\/\" rel=\"noopener noreferrer nofollow\">GoLand<\/a> \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0432\u043e\u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u044b.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/726902\/\"> https:\/\/habr.com\/ru\/articles\/726902\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>JetBrains <a href=\"https:\/\/blog.jetbrains.com\/kotlin\/2023\/04\/kotlin-1-8-20-released\/\" rel=\"noopener noreferrer nofollow\">\u0432\u044b\u043f\u0443\u0441\u0442\u0438\u043b\u0430<\/a> \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u044f\u0437\u044b\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Kotlin 1.8.20. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0451\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 Kotlin K2 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e \u043a\u043e\u0434\u0430 \u0432 WebAssembly.<\/p>\n<p>\u0412 \u0432\u0435\u0440\u0441\u0438\u0438 Kotlin 1.8.20 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 Kotlin K2 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0430\u043b\u044c\u0444\u0430-\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 JS IR \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 Kotlin 2.0. \u0414\u043b\u044f \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 K2 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u044f\u0437\u044b\u043a\u043e\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043e\u043f\u0446\u0438\u0435\u0439 <code>-language-version 2.0<\/code>.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u044d\u0442\u043e \u0432 \u0444\u0430\u0439\u043b\u0435 <code>build.gradle(.kts)<\/code>:<\/p>\n<pre><code>kotlin {    sourceSets.all {        languageSettings {            languageVersion = \"2.0\"        }    } }<\/code><\/pre>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 Kotlin \u043f\u0440\u043e\u0441\u0438\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u0443\u0447\u0430\u0441\u0442\u0438\u0435 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0421\u0432\u043e\u0438 \u043e\u0442\u0437\u044b\u0432\u044b \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u043a\u0430\u043d\u0430\u043b\u0435 Slack. \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043e\u043f\u0446\u0438\u044e \u00ab\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f\u00bb, \u0447\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u0430\u043c \u0438\u0437 JetBrains \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 K2.<\/p>\n<p>\u0412 \u0432\u0435\u0440\u0441\u0438\u0438 Kotlin 1.8.20 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043d\u043e\u0432\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438\u0437 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 Enum. \u0420\u0430\u043d\u044c\u0448\u0435 \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u043c\u0435\u0442\u043e\u0434 <code>values()<\/code>, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0432\u0448\u0438\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f. \u0422\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043b \u043a \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u0432 Java \u0438 Kotlin, \u0430 \u043c\u043d\u043e\u0433\u0438\u0435 API \u0442\u0440\u0435\u0431\u0443\u044e\u0442, \u0447\u0442\u043e\u0431\u044b \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0431\u044b\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c\u0438.<\/p>\n<p>\u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432 \u043a\u043b\u0430\u0441\u0441\u0430\u0445 Enum \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>entries<\/code>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442. \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u043e <code>values()<\/code>, \u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u043f\u043e\u043a\u0430 \u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438:<\/p>\n<pre><code>enum class Color(val colorName: String, val rgb: String) {    RED(\"Red\", \"#FF0000\"),    ORANGE(\"Orange\", \"#FF7F00\"),    YELLOW(\"Yellow\", \"#FFFF00\") }   @OptIn(ExperimentalStdlibApi::class) fun findByRgb(rgb: String): Color? = Color.entries.find { it.rgb == rgb }<\/code><\/pre>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 <code>entries<\/code> \u043f\u043e\u043a\u0430 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0438 \u0435\u0451 \u043d\u0430\u0434\u043e \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e.\u00a0<\/p>\n<p>\u0412 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u043d\u0430 Kotlin \u0432 WebAssembly. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 JetBrains \u0441\u0447\u0438\u0442\u0430\u044e\u0442, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0432\u044b\u0441\u043e\u043a\u043e\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u0434 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435.<\/p>\n<p>\u0414\u043b\u044f \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Kotlin\/Wasm \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0444\u0430\u0439\u043b <code>build.gradle(.kts)<\/code>:<\/p>\n<pre><code>plugins {     kotlin(\"multiplatform\") version \"1.8.20-RC2\" }  kotlin {     wasm {         binaries.executable()         browser {         }     }     sourceSets {         val commonMain by getting         val commonTest by getting {             dependencies {                 implementation(kotlin(\"test\"))             }         }         val wasmMain by getting         val wasmTest by getting     } }<\/code><\/pre>\n<p>\u0412\u043c\u0435\u0441\u0442\u0435 \u0441 \u044d\u0442\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0446\u0435\u043b\u0435\u0432\u0443\u044e \u0441\u0440\u0435\u0434\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430. \u0412 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u043a \u0432\u044b\u043f\u0443\u0441\u043a\u0443 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0434\u043b\u044f Chrome, Firefox \u0438 Edge.<\/p>\n<p>\u0421 \u043f\u043e\u043b\u043d\u044b\u043c \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0432 <a href=\"https:\/\/kotlinlang.org\/docs\/whatsnew1820.html\" rel=\"noopener noreferrer nofollow\">\u0431\u043b\u043e\u0433\u0435<\/a> JetBrains \u0438\u043b\u0438 \u0432 <a href=\"https:\/\/github.com\/JetBrains\/kotlin\/releases\/tag\/v1.8.20\" rel=\"noopener noreferrer nofollow\">\u0437\u0430\u043f\u0438\u0441\u044f\u0445<\/a> \u043a \u0440\u0435\u043b\u0438\u0437\u0443 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 GitHub. \u0412\u043c\u0435\u0441\u0442\u0435 \u0441 Kotlin \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f \u043e\u0431\u043d\u043e\u0432\u0438\u043b\u0430 \u00a0<a href=\"https:\/\/habr.com\/ru\/news\/t\/726450\/\" rel=\"noopener noreferrer nofollow\">PyCharm<\/a>, <a href=\"https:\/\/habr.com\/ru\/news\/t\/726510\/\" rel=\"noopener noreferrer nofollow\">IntelliJ IDEA<\/a>, <a href=\"https:\/\/habr.com\/ru\/news\/t\/726542\/\" rel=\"noopener noreferrer nofollow\">WebStorm<\/a>, <a href=\"https:\/\/habr.com\/ru\/news\/t\/726560\/\" rel=\"noopener noreferrer nofollow\">Aqua IDE<\/a>, <a href=\"https:\/\/habr.com\/ru\/news\/726884\/\" rel=\"noopener noreferrer nofollow\">GoLand<\/a> \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0432\u043e\u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u044b.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/726902\/\"> https:\/\/habr.com\/ru\/articles\/726902\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-410945","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/410945","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=410945"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/410945\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=410945"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=410945"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=410945"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}