title: Why can "return" return a "return" in Kotlin?
body: <p>The question may sound silly, but there is no typo in it.</p>
  
  <pre><code>fun test(): Any {
      return return true
  }
  </code></pre>
  
  <p>This is actually possible in Kotlin. Although the compiler warns about</p>
  
  <blockquote>
    <p>Unreachable code</p>
  </blockquote>
  
  <p>for the outer return. But this is just a warning.</p>
  
  <p>I don't want to compare Java with Kotlin, but I was interested whether the same would work in Java.</p>
  
  <pre><code>public class Test {
    // ...
    static int test() {
      return return 1;
    }
  }
  </code></pre>
  
  <p>It does not!</p>
  
  <blockquote>
    <p>/Test.java:8: error: illegal start of expression<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return return 1;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;^<br>
    /Test.java:8: error: not a statement<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return return 1;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;^<br>
    2 errors</p>
  </blockquote>
  
  <p>Why was Kotlin designed this way?</p>