{"id":290192,"date":"2018-10-02T11:55:02","date_gmt":"2018-10-02T07:55:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=290192"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=290192","title":{"rendered":"Kotlin \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u2014 \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0431\u0430\u0439\u0442\u043a\u043e\u0434"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/td\/cc\/c_\/tdccc_ssurbmauha71hwiknznlw.png\"\/><\/p>\n<p>  \u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0434\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0432 Java \u0431\u0430\u0439\u0442\u043a\u043e\u0434\u0430 Kotlin \u0435\u0434\u0432\u0430 \u043b\u0438 \u043d\u0435 \u043b\u0443\u0447\u0448\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u043d\u044f\u0442\u044c \u043a\u0430\u043a \u043e\u043d \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438 \u043a\u0430\u043a \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u044f\u0437\u044b\u043a\u0430 \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430 \u043f\u0435\u0440\u0444\u043e\u043c\u0430\u043d\u0441. \u041c\u043d\u043e\u0433\u0438\u0435 \u0441\u0430\u043c\u043e \u0441\u043e\u0431\u043e\u0439 \u0443\u0436\u0435 \u0434\u0430\u0432\u043d\u043e \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043b\u0438, \u0442\u0430\u043a \u0447\u0442\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u0443\u0434\u0435\u0442 \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432 \u0438 \u0442\u0435\u0445, \u043a\u0442\u043e \u0443\u0436\u0435 \u0434\u0430\u0432\u043d\u043e \u043e\u0441\u0438\u043b\u0438\u043b Java \u0438 \u0440\u0435\u0448\u0438\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Kotlin \u043d\u0435\u0434\u0430\u0432\u043d\u043e.<\/p>\n<p>  \u042f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0443\u043f\u0443\u0449\u0443 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0438\u0437\u0431\u0438\u0442\u044b\u0435 \u0438 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0442\u0430\u043a \u043a\u0430\u043a, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u0432 \u0441\u043e\u0442\u044b\u0439 \u0440\u0430\u0437 \u043f\u0438\u0441\u0430\u0442\u044c \u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0433\u0435\u0442\u0442\u0435\u0440\u043e\u0432\/\u0441\u0435\u0442\u0442\u0435\u0440\u043e\u0432 \u0434\u043b\u044f var \u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0432\u0435\u0449\u0430\u0445. \u0418\u0442\u0430\u043a \u043d\u0430\u0447\u043d\u0435\u043c.<a name=\"habracut\"><\/a><\/p>\n<h3>\u041a\u0430\u043a \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0434\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0431\u0430\u0439\u0442\u043a\u043e\u0434 \u0432 Intellij Idea?<\/h3>\n<p>  \u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u2014 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0432 \u043c\u0435\u043d\u044e Tools -&gt; Kotlin -&gt; Show Kotlin Bytecode<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/jx\/wq\/jl\/jxwqjlspj8h1uheztj7sjj_wodo.png\" alt=\"image\"\/><\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0432 \u043f\u043e\u044f\u0432\u0438\u0432\u0448\u0435\u043c\u0441\u044f \u043e\u043a\u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c Decompile<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/_y\/44\/qx\/_y44qxgtmibiqw3n0iimbwxbavi.png\"\/><\/p>\n<p>  \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u0435\u0440\u0441\u0438\u044f Kotlin 1.3-RC.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c, \u043d\u0430\u043a\u043e\u043d\u0446\u0435-\u0442\u043e, \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438.<\/p>\n<h3>object<\/h3>\n<p>  Kotlin<\/p>\n<pre><code>object Test<\/code><\/pre>\n<p>  Decompiled Java<\/p>\n<pre><code class=\"java\">public final class Test {    public static final Test INSTANCE;     static {       Test var0 = new Test();       INSTANCE = var0;    } }<\/code><\/pre>\n<p>  \u042f \u043f\u043e\u043b\u0430\u0433\u0430\u044e \u0432\u0441\u0435, \u043a\u0442\u043e \u0438\u043c\u0435\u0435\u0442 \u0434\u0435\u043b\u043e \u0441 Kotlin \u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e object \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0441\u0438\u043d\u0433\u043b\u0442\u043e\u043d. \u041e\u0434\u043d\u0430\u043a\u043e, \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0441\u0435\u043c \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e \u043a\u0430\u043a\u043e\u0439 \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0438\u043d\u0433\u043b\u0442\u043e\u043d \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u043e\u043d \u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c.<\/p>\n<p>  \u041f\u043e \u0434\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c\u0443 \u043a\u043e\u0434\u0443 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0441\u0438\u043d\u0433\u043b\u0442\u043e\u043d \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 eager \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u0438\u043d\u0433\u043b\u0442\u043e\u043d\u0430, \u043e\u043d \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u043a\u043b\u0430\u0441\u0441\u043b\u043e\u0443\u0434\u0435\u0440 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u043a\u043b\u0430\u0441\u0441. \u041f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c \u043e\u043d \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u0443\u0441\u043b\u043e\u0432\u043d\u043e \u2014 \u0441 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b static \u0431\u043b\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u043a\u043b\u0430\u0441\u0441\u043b\u043e\u0443\u0434\u0435\u0440\u043e\u043c, \u0447\u0442\u043e \u0441\u0430\u043c\u043e \u043f\u043e \u0441\u0435\u0431\u0435 \u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e. \u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0435\u0441\u043b\u0438 \u043a\u043b\u0430\u0441\u0441\u043b\u043e\u0443\u0434\u0435\u0440\u043e\u0432 \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0434\u043d\u043e\u0433\u043e, \u0442\u043e \u0438 \u043e\u0434\u043d\u0438\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u043e\u0442\u0434\u0435\u043b\u0430\u0442\u044c\u0441\u044f.<\/p>\n<h3>extensions<\/h3>\n<p>  Kotlin<\/p>\n<pre><code>fun String.getEmpty(): String {     return &quot;&quot; }<\/code><\/pre>\n<p>  Decompiled Java<\/p>\n<pre><code class=\"java\">public final class TestKt {    @NotNull    public static final String getEmpty(@NotNull String $receiver) {       Intrinsics.checkParameterIsNotNull($receiver, &quot;receiver$0&quot;);       return &quot;&quot;;    } }<\/code><\/pre>\n<p>  \u0422\u0443\u0442 \u0432 \u043e\u0431\u0449\u0435\u043c \u0432\u0441\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u2014 \u044d\u043a\u0441\u0442\u0435\u043d\u0448\u043d\u044b \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0441\u0430\u0445\u0430\u0440\u043a\u043e\u043c \u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043a\u043e\u0433\u043e-\u0442\u043e \u0441\u043c\u0443\u0442\u0438\u043b\u0430 \u0441\u0442\u0440\u043e\u0447\u043a\u0430 \u0441 Intrinsics.checkParameterIsNotNull, \u0442\u043e \u0438 \u0442\u0430\u043c \u0432\u0441\u0435 \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e \u2014 \u0432\u043e \u0432\u0441\u0435\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445 \u0441 \u043d\u0435 nullable \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 Kotlin \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0430 null \u0438 \u043a\u0438\u0434\u0430\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u0434\u0441\u0443\u043d\u0443\u043b\u0438 <s>\u0441\u0432\u0438\u043d\u044c\u044e<\/s> null, \u0445\u043e\u0442\u044f \u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u0445 \u043e\u0431\u0435\u0449\u0430\u043b\u0438 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c. \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"java\">public static void checkParameterIsNotNull(Object value, String paramName) {     if (value == null) {         throwParameterIsNullException(paramName);     } }<\/code><\/pre>\n<p>  \u0427\u0442\u043e \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u043d\u043e, \u0435\u0441\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0430 extension property<\/p>\n<pre><code>val String.empty: String     get() {     return &quot;&quot; }<\/code><\/pre>\n<p>  \u0422\u043e \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0440\u043e\u0432\u043d\u043e \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0434\u043b\u044f \u043c\u0435\u0442\u043e\u0434\u0430 String.getEmpty()<\/p>\n<h3>inline<\/h3>\n<p>  Kotlin<\/p>\n<pre><code>inline fun something() {     println(&quot;hello&quot;) }  class Test {     fun test() {         something()     } }<\/code><\/pre>\n<p>  Decompiled Java<\/p>\n<pre><code class=\"java\">public final class Test {    public final void test() {       String var1 = &quot;hello&quot;;       System.out.println(var1);    } }  public final class TestKt {    public static final void something() {       String var1 = &quot;hello&quot;;       System.out.println(var1);    } } <\/code><\/pre>\n<p>  \u0421 \u0438\u043d\u043b\u0430\u0439\u043d\u043e\u043c \u0432\u0441\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u0430\u044f \u043a\u0430\u043a inline \u043f\u0440\u043e\u0441\u0442\u043e \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0442\u043e \u043c\u0435\u0441\u0442\u043e, \u043e\u0442\u043a\u0443\u0434\u0430 \u0435\u0435 \u0432\u044b\u0437\u0432\u0430\u043b\u0438. \u0427\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u2014 \u043e\u043d\u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u0430\u043c\u0430 \u043f\u043e \u0441\u0435\u0431\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0442\u0441\u044f \u0432 \u0441\u0442\u0430\u0442\u0438\u043a\u0443, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0434\u043b\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 interoperability \u0441 Java.<\/p>\n<p>  \u0412\u0441\u044f \u043c\u043e\u0449\u044c \u0438\u043d\u043b\u0430\u0439\u043d\u0430 \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u0445 \u0437\u043d\u0430\u0447\u0438\u0442\u0441\u044f <b>\u043b\u044f\u043c\u0431\u0434\u0430<\/b>:<\/p>\n<p>  Kotlin<\/p>\n<pre><code>inline fun something(action: () -&gt; Unit) {     action()     println(&quot;world&quot;) }  class Test {     fun test() {         something {             println(&quot;hello&quot;)         }     } }<\/code><\/pre>\n<p>  Decompiled Java<\/p>\n<pre><code>public final class Test {    public final void test() {       String var1 = &quot;hello&quot;;       System.out.println(var1);       var1 = &quot;world&quot;;       System.out.println(var1);    } }  public final class TestKt {    public static final void something(@NotNull Function0 action) {       Intrinsics.checkParameterIsNotNull(action, &quot;action&quot;);       action.invoke();       String var2 = &quot;world&quot;;       System.out.println(var2);    } }<\/code><\/pre>\n<p>  \u0412 \u043d\u0438\u0436\u043d\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043e\u043f\u044f\u0442\u044c \u0432\u0438\u0434\u043d\u0430 \u0441\u0442\u0430\u0442\u0438\u043a\u0430, \u0430 \u0432 \u0432\u0435\u0440\u0445\u043d\u0435\u0439 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043b\u044f\u043c\u0431\u0434\u0430 \u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0442\u0430\u043a\u0436\u0435 \u0438\u043d\u043b\u0430\u0439\u043d\u0438\u0442\u0441\u044f, \u0430 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u043a\u0430\u043a \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0432 Java.<\/p>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043d\u0430 \u044d\u0442\u043e\u043c \u043f\u043e\u0437\u043d\u0430\u043d\u0438\u044f inline \u0432 Kotlin \u0443 \u043c\u043d\u043e\u0433\u0438\u0445 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f, \u043d\u043e \u0435\u0441\u0442\u044c \u0435\u0449\u0435 2 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u043c\u043e\u043c\u0435\u043d\u0442\u0430, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e noinline \u0438 crossinline. \u042d\u0442\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a \u043b\u044f\u043c\u0431\u0434\u0435 \u044f\u0432\u043b\u044f\u044e\u0449\u0435\u0439\u0441\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0432 \u0438\u043d\u043b\u0430\u0439\u043d \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>  Kotlin<\/p>\n<pre><code>inline fun something(noinline action: () -&gt; Unit) {     action()     println(&quot;world&quot;) }  class Test {     fun test() {         something {             println(&quot;hello&quot;)         }     } }<\/code><\/pre>\n<p>  Decompiled Java  <\/p>\n<pre><code class=\"java\">public final class Test {    public final void test() {       Function0 action$iv = (Function0)null.INSTANCE;       action$iv.invoke();       String var2 = &quot;world&quot;;       System.out.println(var2);    } }  public final class TestKt {    public static final void something(@NotNull Function0 action) {       Intrinsics.checkParameterIsNotNull(action, &quot;action&quot;);       action.invoke();       String var2 = &quot;world&quot;;       System.out.println(var2);    } }<\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 IDE \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u0438\u043d\u043b\u0430\u0439\u043d \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0447\u0443\u0442\u044c \u043c\u0435\u043d\u0435\u0435 \u0447\u0435\u043c \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e. \u0410 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442 \u0440\u043e\u0432\u043d\u043e \u0432 \u0442\u043e \u0436\u0435, \u0447\u0442\u043e \u0438 Java \u2014 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 Function0. \u041f\u043e\u0447\u0435\u043c\u0443 \u0434\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0441\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u043c (Function0)null.INSTANCE; \u2014 \u044f \u0431\u0435\u0437 \u043f\u043e\u043d\u044f\u0442\u0438\u044f, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e \u0431\u0430\u0433 \u0434\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430.<\/p>\n<p>  crossinline \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0434\u0435\u043b\u0430\u0435\u0442 \u0440\u043e\u0432\u043d\u043e \u0442\u043e \u0436\u0435, \u0447\u0442\u043e \u0438 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 inline (\u0442\u043e \u0435\u0441\u0442\u044c \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0434 \u043b\u044f\u043c\u0431\u0434\u043e\u0439 \u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0435 \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0438\u0447\u0435\u0433\u043e), \u0437\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u2014 \u0432 \u043b\u044f\u043c\u0431\u0434\u0435 \u043d\u0435\u043b\u044c\u0437\u044f \u043f\u0438\u0441\u0430\u0442\u044c return, \u0447\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043b\u044f \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0443\u044e inline. \u0412 \u0441\u043c\u044b\u0441\u043b\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c-\u0442\u043e \u043c\u043e\u0436\u043d\u043e, \u043d\u043e \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445 IDE \u0431\u0443\u0434\u0435\u0442 \u0440\u0443\u0433\u0430\u0442\u044c\u0441\u044f, \u0430 \u0432\u043e \u0432\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043c<\/p>\n<blockquote><p> &#8216;return&#8217; is not allowed here<\/p><\/blockquote>\n<p> \u0412\u043f\u0440\u043e\u0447\u0435\u043c, \u0431\u0430\u0439\u0442\u043a\u043e\u0434 \u0443 crossinline \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u043e\u0433\u043e \u0438\u043d\u043b\u0430\u0439\u043d\u0430 \u2014 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c.<\/p>\n<h3>infix<\/h3>\n<p>  Kotlin<\/p>\n<pre><code>infix fun Int.plus(value: Int): Int {     return this+value }  class Test {     fun test() {         val result = 5 plus 3     } }<\/code><\/pre>\n<p>  Decompiled Java<\/p>\n<pre><code class=\"java\">public final class Test {    public final void test() {       int result = TestKt.plus(5, 3);    } }  public final class TestKt {    public static final int plus(int $receiver, int value) {       return $receiver + value;    } }<\/code><\/pre>\n<p>  \u0418\u043d\u0444\u0438\u043a\u0441\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u0438 \u044d\u043a\u0441\u0442\u0435\u043d\u0448\u043d\u044b \u0432 \u043e\u0431\u044b\u0447\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u0438\u043a\u0443<\/p>\n<h3>tailrec<\/h3>\n<p>  Kotlin<\/p>\n<pre><code>tailrec fun factorial(step:Int, value: Int = 1):Int {     val newValue = step*value     return if (step == 1) newValue else factorial(step - 1,newValue) }<\/code><\/pre>\n<p>  Decompiled Java<\/p>\n<pre><code class=\"java\">public final class TestKt {    public static final int factorial(int step, int value) {       while(true) {          int newValue = step * value;          if (step == 1) {             return newValue;          }           int var10000 = step - 1;          value = newValue;          step = var10000;       }    }     \/\/ $FF: synthetic method    public static int factorial$default(int var0, int var1, int var2, Object var3) {       if ((var2 & 2) != 0) {          var1 = 1;       }        return factorial(var0, var1);    } }<\/code><\/pre>\n<p>  tailrec \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0437\u0430\u043d\u044f\u0442\u043d\u043e\u0439 \u0448\u0442\u0443\u043a\u043e\u0439. \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u043a\u043e\u0434\u0430 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0433\u043e\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u043a\u0443\u0434\u0430 \u043c\u0435\u043d\u0435\u0435 \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u0439 \u0446\u0438\u043a\u043b, \u0437\u0430\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043c\u043e\u0436\u0435\u0442 \u0441\u043f\u0430\u0442\u044c \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0432\u044b\u043b\u0435\u0442\u0438\u0442 \u0441\u043e Stackoverflow \u0432 \u0441\u0430\u043c\u044b\u0439 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442. \u0414\u0440\u0443\u0433\u043e\u0435 \u0434\u0435\u043b\u043e \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0436\u0438\u0437\u043d\u0438 \u043d\u0430\u0439\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 tailrec \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0440\u0435\u0434\u043a\u043e.<\/p>\n<h3>reified<\/h3>\n<p>  Kotlin<\/p>\n<pre><code>inline fun &lt;reified T&gt;something(value: Class&lt;T&gt;) {     println(value.simpleName) } <\/code><\/pre>\n<p>  Decompiled Java<\/p>\n<pre><code class=\"java\">public final class TestKt {    private static final void something(Class value) {       String var2 = value.getSimpleName();       System.out.println(var2);    } }<\/code><\/pre>\n<p>  \u0412\u043e\u043e\u0431\u0449\u0435 \u043f\u0440\u043e \u0441\u0430\u043c\u0443 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e reified \u0438 \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u044d\u0442\u043e \u043d\u0430\u0434\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0446\u0435\u043b\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e. \u0415\u0441\u043b\u0438 \u0432\u043a\u0440\u0430\u0434\u0446\u0435, \u0442\u043e \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u0442\u0438\u043f\u0443 \u0432 Java \u0432 compile time \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u0435\u043d, \u0442.\u043a. \u0434\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 Java \u0437\u043d\u0430\u0442\u044c \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u0447\u0442\u043e \u0442\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u043e\u0431\u0449\u0435. \u041a\u043e\u0442\u043b\u0438\u043d \u2014 \u0434\u0440\u0443\u0433\u043e\u0435 \u0434\u0435\u043b\u043e. \u041a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e reified \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0432 inline \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u0430\u043a \u0443\u0436\u0435 \u043e\u0442\u043c\u0435\u0447\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u043e\u043f\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0438 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432 \u043d\u0443\u0436\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0443\u0436\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u00ab\u0432\u044b\u0437\u043e\u0432\u0430\u00bb \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 <b>\u0443\u0436\u0435 <\/b>\u0432 \u043a\u0443\u0440\u0441\u0435 \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043c \u0437\u0430 \u0442\u0438\u043f \u0438 \u043c\u043e\u0436\u0435\u0442 \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0430\u0439\u0442\u043a\u043e\u0434.<\/p>\n<p>  \u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0432 \u0431\u0430\u0439\u0442\u043a\u043e\u0434\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0441 <b>\u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u043c<\/b> \u0443\u0440\u043e\u0432\u043d\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u0430, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0438\u0437 Java \u0442\u0430\u043a\u043e\u0435 \u0434\u0435\u0440\u043d\u0443\u0442\u044c \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f. \u041a \u0441\u043b\u043e\u0432\u0443 \u0438\u0437-\u0437\u0430 reified \u0432 \u0440\u0435\u043a\u043b\u0430\u043c\u0435 Kotlin<a href=\"https:\/\/kotlinlang.org\/\"> \u00ab100% interoperable with Java and Android\u00bb<\/a> \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043d\u0435\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/media3.giphy.com\/media\/3oEduMq533nKRQI3YI\/giphy.gif\" alt=\"image\"\/><\/p>\n<p>  \u041c\u043e\u0436\u0435\u0442 \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 99%?<\/p>\n<h3>init<\/h3>\n<p>  Kotlin<\/p>\n<pre><code>class Test {     constructor()     constructor(value: String)          init {         println(&quot;hello&quot;)     } }<\/code><\/pre>\n<p>  Decompiled Java<\/p>\n<pre><code class=\"java\">public final class Test {    public Test() {       String var1 = &quot;hello&quot;;       System.out.println(var1);    }     public Test(@NotNull String value) {       Intrinsics.checkParameterIsNotNull(value, &quot;value&quot;);       super();       String var2 = &quot;hello&quot;;       System.out.println(var2);    } }<\/code><\/pre>\n<p>  \u0412 \u0446\u0435\u043b\u043e\u043c \u0441 init \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u2014 \u044d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u0430\u044f inline \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 <b>\u0434\u043e<\/b> \u0432\u044b\u0437\u043e\u0432\u0430 \u043a\u043e\u0434\u0430 \u0441\u0430\u043c\u043e\u0433\u043e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430.<\/p>\n<h3>data class<\/h3>\n<p>  Kotlin<\/p>\n<pre><code>data class Test(val argumentValue: String, val argumentValue2: String) {     var innerValue: Int = 0 }<\/code><\/pre>\n<p>  Decompiled Java<\/p>\n<pre><code class=\"java\">public final class Test {    private int innerValue;    @NotNull    private final String argumentValue;    @NotNull    private final String argumentValue2;     public final int getInnerValue() {       return this.innerValue;    }     public final void setInnerValue(int var1) {       this.innerValue = var1;    }     @NotNull    public final String getArgumentValue() {       return this.argumentValue;    }     @NotNull    public final String getArgumentValue2() {       return this.argumentValue2;    }     public Test(@NotNull String argumentValue, @NotNull String argumentValue2) {       Intrinsics.checkParameterIsNotNull(argumentValue, &quot;argumentValue&quot;);       Intrinsics.checkParameterIsNotNull(argumentValue2, &quot;argumentValue2&quot;);       super();       this.argumentValue = argumentValue;       this.argumentValue2 = argumentValue2;    }     @NotNull    public final String component1() {       return this.argumentValue;    }     @NotNull    public final String component2() {       return this.argumentValue2;    }     @NotNull    public final Test copy(@NotNull String argumentValue, @NotNull String argumentValue2) {       Intrinsics.checkParameterIsNotNull(argumentValue, &quot;argumentValue&quot;);       Intrinsics.checkParameterIsNotNull(argumentValue2, &quot;argumentValue2&quot;);       return new Test(argumentValue, argumentValue2);    }     \/\/ $FF: synthetic method    @NotNull    public static Test copy$default(Test var0, String var1, String var2, int var3, Object var4) {       if ((var3 & 1) != 0) {          var1 = var0.argumentValue;       }        if ((var3 & 2) != 0) {          var2 = var0.argumentValue2;       }        return var0.copy(var1, var2);    }     @NotNull    public String toString() {       return &quot;Test(argumentValue=&quot; + this.argumentValue + &quot;, argumentValue2=&quot; + this.argumentValue2 + &quot;)&quot;;    }     public int hashCode() {       return (this.argumentValue != null ? this.argumentValue.hashCode() : 0) * 31 + (this.argumentValue2 != null ? this.argumentValue2.hashCode() : 0);    }     public boolean equals(@Nullable Object var1) {       if (this != var1) {          if (var1 instanceof Test) {             Test var2 = (Test)var1;             if (Intrinsics.areEqual(this.argumentValue, var2.argumentValue) && Intrinsics.areEqual(this.argumentValue2, var2.argumentValue2)) {                return true;             }          }           return false;       } else {          return true;       }    } }<\/code><\/pre>\n<p>  \u0427\u0435\u0441\u0442\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u0434\u0430\u0442\u0430 \u043a\u043b\u0430\u0441\u0441\u044b, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0443\u0436\u0435 \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043a\u0430\u0437\u0430\u043d\u043e, \u043d\u043e \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0435\u0441\u0442\u044c \u043f\u0430\u0440\u0430 \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432 \u0437\u0430\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0445 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 equals\/hashCode\/copy\/toString \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u044b \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440. \u041d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u043f\u043e\u0447\u0435\u043c\u0443 \u0442\u0430\u043a \u2014 \u0410\u043d\u0434\u0440\u0435\u0439 \u0411\u0440\u0435\u0441\u043b\u0430\u0432 \u043e\u0442\u0432\u0435\u0442\u0438\u043b, \u0447\u0442\u043e \u0431\u0440\u0430\u0442\u044c \u0435\u0449\u0435 \u0438 \u043f\u043e\u043b\u044f \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u0441\u043b\u043e\u0436\u043d\u043e \u0438 \u0437\u0430\u043f\u0430\u0440\u043d\u043e. \u041a \u0441\u043b\u043e\u0432\u0443 \u043e\u0442 \u0434\u0430\u0442\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 \u043d\u0435\u043b\u044c\u0437\u044f \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u043f\u0440\u0430\u0432\u0434\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c\u0443, <a href=\"https:\/\/discuss.kotlinlang.org\/t\/data-class-inheritance\/4107\">\u0447\u0442\u043e \u043f\u0440\u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0430\u0433\u0435\u043d\u0435\u0440\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0435 \u0431\u044b\u043b \u0431\u044b \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u043c<\/a>. \u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434 component1() \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044f. \u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u0442\u043e\u043b\u044c\u043a\u043e componentN() \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435. \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u043e, \u043d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043d\u0443\u0436\u043d\u043e \u044d\u0442\u043e \u0434\u043b\u044f <a href=\"https:\/\/kotlinlang.org\/docs\/reference\/multi-declarations.html\">destructuring declaration<\/a>.<\/p>\n<h3>destructuring declaration<\/h3>\n<p>  \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0434\u0430\u0442\u0430 \u043a\u043b\u0430\u0441\u0441\u043e\u043c \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<p>  Kotlin<\/p>\n<pre><code>class DestructuringDeclaration {     fun test() {         val (one, two) = Test(&quot;hello&quot;, &quot;world&quot;)     } }<\/code><\/pre>\n<p>  Decompiled Java<\/p>\n<pre><code class=\"java\">public final class DestructuringDeclaration {    public final void test() {       Test var3 = new Test(&quot;hello&quot;, &quot;world&quot;);       String var1 = var3.component1();       String two = var3.component2();    } }<\/code><\/pre>\n<p>  \u041e\u0431\u044b\u0447\u043d\u043e \u044d\u0442\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u044b\u043b\u0438\u0442\u0441\u044f \u043d\u0430 \u043f\u043e\u043b\u043a\u0435, \u043d\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c \u043c\u0430\u043f.<\/p>\n<h3>operator<\/h3>\n<p>  Kotlin<\/p>\n<pre><code>class Something(var likes: Int = 0) {     operator fun inc() = Something(likes+1) }  class Test() {     fun test() {         var something = Something()         something++     } }<\/code><\/pre>\n<p>  Decompiled Java<\/p>\n<pre><code class=\"java\">public final class Something {    private int likes;     @NotNull    public final Something inc() {       return new Something(this.likes + 1);    }     public final int getLikes() {       return this.likes;    }     public final void setLikes(int var1) {       this.likes = var1;    }     public Something(int likes) {       this.likes = likes;    }     \/\/ $FF: synthetic method    public Something(int var1, int var2, DefaultConstructorMarker var3) {       if ((var2 & 1) != 0) {          var1 = 0;       }        this(var1);    }     public Something() {       this(0, 1, (DefaultConstructorMarker)null);    } }  public final class Test {    public final void test() {       Something something = new Something(0, 1, (DefaultConstructorMarker)null);       something = something.inc();    } }<\/code><\/pre>\n<p>  \u041a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e operator \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u044f\u0437\u044b\u043a\u0430 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430. \u0427\u0435\u0441\u0442\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u044f \u043d\u0438 \u0440\u0430\u0437\u0443 \u043d\u0435 \u0432\u0438\u0434\u0435\u043b \u0447\u0442\u043e\u0431 \u044d\u0442\u043e \u043a\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b, \u043d\u043e \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0442\u0430\u043a\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0435\u0441\u0442\u044c, \u0430 \u043c\u0430\u0433\u0438\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0442. \u041f\u043e \u0441\u0443\u0442\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0434\u043c\u0435\u043d\u044f\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u043d\u0430 \u043d\u0443\u0436\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u043a typealias \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0442\u0438\u043f.<br \/>  \u0418 \u0434\u0430, \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u0440\u044f\u043c\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u043e\u0434\u0443\u043c\u0430\u043b\u0438 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u043e\u0441\u0442\u0438 ( === \u043a\u043e\u0442\u043e\u0440\u044b\u0439), \u0442\u043e \u0441\u043f\u0435\u0448\u0443 \u043e\u0433\u043e\u0440\u0447\u0438\u0442\u044c, \u044d\u0442\u043e \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f.<\/p>\n<h3>inline class <\/h3>\n<p>  Kotlin<\/p>\n<pre><code>inline class User(internal val name: String) {     fun upperCase(): String {         return name.toUpperCase()     } }  class Test {     fun test() {         val user = User(&quot;Some1&quot;)         println(user.upperCase())     } } <\/code><\/pre>\n<p>  Decompiled Java<\/p>\n<pre><code class=\"java\">public final class Test {    public final void test() {       String user = User.constructor-impl(&quot;Some1&quot;);       String var2 = User.upperCase-impl(user);       System.out.println(var2);    } }  public final class User {    @NotNull    private final String name;     \/\/ $FF: synthetic method    private User(@NotNull String name) {       Intrinsics.checkParameterIsNotNull(name, &quot;name&quot;);       super();       this.name = name;    }     @NotNull    public static final String upperCase_impl\/* $FF was: upperCase-impl*\/(String $this) {       if ($this == null) {          throw new TypeCastException(&quot;null cannot be cast to non-null type java.lang.String&quot;);       } else {          String var10000 = $this.toUpperCase();          Intrinsics.checkExpressionValueIsNotNull(var10000, &quot;(this as java.lang.String).toUpperCase()&quot;);          return var10000;       }    }     @NotNull    public static String constructor_impl\/* $FF was: constructor-impl*\/(@NotNull String name) {       Intrinsics.checkParameterIsNotNull(name, &quot;name&quot;);       return name;    }     \/\/ $FF: synthetic method    @NotNull    public static final User box_impl\/* $FF was: box-impl*\/(@NotNull String v) {       Intrinsics.checkParameterIsNotNull(v, &quot;v&quot;);       return new User(v);    }     @NotNull    public static String toString_impl\/* $FF was: toString-impl*\/(String var0) {       return &quot;User(name=&quot; + var0 + &quot;)&quot;;    }     public static int hashCode_impl\/* $FF was: hashCode-impl*\/(String var0) {       return var0 != null ? var0.hashCode() : 0;    }     public static boolean equals_impl\/* $FF was: equals-impl*\/(String var0, @Nullable Object var1) {       if (var1 instanceof User) {          String var2 = ((User)var1).unbox-impl();          if (Intrinsics.areEqual(var0, var2)) {             return true;          }       }        return false;    }     public static final boolean equals_impl0\/* $FF was: equals-impl0*\/(@NotNull String p1, @NotNull String p2) {       Intrinsics.checkParameterIsNotNull(p1, &quot;p1&quot;);       Intrinsics.checkParameterIsNotNull(p2, &quot;p2&quot;);       throw null;    }     \/\/ $FF: synthetic method    @NotNull    public final String unbox_impl\/* $FF was: unbox-impl*\/() {       return this.name;    }     public String toString() {       return toString-impl(this.name);    }     public int hashCode() {       return hashCode-impl(this.name);    }     public boolean equals(Object var1) {       return equals-impl(this.name, var1);    } }<\/code><\/pre>\n<p>  \u0418\u0437 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u2014 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435, \u0432\u043f\u0440\u043e\u0447\u0435\u043c \u043e\u043d\u043e \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0447\u0442\u043e \u0438\u043d\u043b\u0430\u0439\u043d \u043a\u043b\u0430\u0441\u0441 \u044d\u0442\u043e \u0432 \u0446\u0435\u043b\u043e\u043c \u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u043d\u0430\u0434 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043e\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439. \u0418\u043d\u043b\u0430\u0439\u043d \u043a\u043b\u0430\u0441\u0441 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u0441\u0435\u0431\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u043d\u043e \u043e\u043d\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u043e\u0431\u044b\u0447\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u0438\u043a\u0443. \u0422\u0430\u043a\u0436\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0438\u043d\u0442\u0435\u0440\u043e\u043f\u0430 \u0441 Java \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b. <\/p>\n<h3>\u0418\u0442\u043e\u0433<\/h3>\n<p>  \u041d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e, \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445 \u043d\u0435 \u043b\u044e\u0431\u043e\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0434\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d. \u041e\u0434\u043d\u0430\u043a\u043e \u0441\u0430\u043c\u0430 \u043f\u043e \u0441\u0435\u0431\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0434\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 Kotlin \u0432\u0435\u0441\u044c\u043c\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0438 \u043c\u043e\u0436\u0435\u0442 \u043c\u043d\u043e\u0433\u043e\u0435 \u043f\u0440\u043e\u044f\u0441\u043d\u0438\u0442\u044c.<\/div>\n<p>        <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <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\/post\/425077\/\"> https:\/\/habr.com\/post\/425077\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/td\/cc\/c_\/tdccc_ssurbmauha71hwiknznlw.png\"\/><\/p>\n<p>  \u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0434\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0432 Java \u0431\u0430\u0439\u0442\u043a\u043e\u0434\u0430 Kotlin \u0435\u0434\u0432\u0430 \u043b\u0438 \u043d\u0435 \u043b\u0443\u0447\u0448\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u043d\u044f\u0442\u044c \u043a\u0430\u043a \u043e\u043d \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438 \u043a\u0430\u043a \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u044f\u0437\u044b\u043a\u0430 \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430 \u043f\u0435\u0440\u0444\u043e\u043c\u0430\u043d\u0441. \u041c\u043d\u043e\u0433\u0438\u0435 \u0441\u0430\u043c\u043e \u0441\u043e\u0431\u043e\u0439 \u0443\u0436\u0435 \u0434\u0430\u0432\u043d\u043e \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043b\u0438, \u0442\u0430\u043a \u0447\u0442\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u0443\u0434\u0435\u0442 \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432 \u0438 \u0442\u0435\u0445, \u043a\u0442\u043e \u0443\u0436\u0435 \u0434\u0430\u0432\u043d\u043e \u043e\u0441\u0438\u043b\u0438\u043b Java \u0438 \u0440\u0435\u0448\u0438\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Kotlin \u043d\u0435\u0434\u0430\u0432\u043d\u043e.<\/p>\n<p>  \u042f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0443\u043f\u0443\u0449\u0443 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0438\u0437\u0431\u0438\u0442\u044b\u0435 \u0438 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0442\u0430\u043a \u043a\u0430\u043a, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u0432 \u0441\u043e\u0442\u044b\u0439 \u0440\u0430\u0437 \u043f\u0438\u0441\u0430\u0442\u044c \u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0433\u0435\u0442\u0442\u0435\u0440\u043e\u0432\/\u0441\u0435\u0442\u0442\u0435\u0440\u043e\u0432 \u0434\u043b\u044f var \u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0432\u0435\u0449\u0430\u0445. \u0418\u0442\u0430\u043a \u043d\u0430\u0447\u043d\u0435\u043c.<\/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-290192","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/290192","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=290192"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/290192\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=290192"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=290192"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=290192"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}