title: What's the intended use of @JvmSynthetic in Kotlin?
body: <p>I have come across the <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.jvm/-jvm-synthetic/index.html" rel="nofollow noreferrer"><code>@JvmSynthetic</code></a> annotation in kotlin-stdlib, and I'm wondering what it is for, but, unfortunately, it is undocumented. (UPD: it was at that moment)</p>
  
  <p>As far as I understand, applying it to a program element will add the <code>synthetic</code> modifier to the corresponding bytecode elements. As a consequence, the element becomes invisible from Java:</p>
  
  <pre><code>class MyClass {
      @JvmSynthetic
      fun f() { }
  }
  </code></pre>
  
  <p>Somewhere in Java code:</p>
  
  <pre><code>MyClass c = new MyClass();
  c.f() // Error: cannot resolve method f()
  </code></pre>
  
  <p>But the same elements are still visible in Kotlin code:</p>
  
  <pre><code>val c = MyClass()
  c.f() // OK
  </code></pre>
  
  <p>Is hiding declarations from non-Kotlin sources a valid use of <code>@JvmSynthetic</code>? Is it the intended use? What are the other appropriate use cases?</p>
  
  <p>Since <code>@JvmSynthetic</code> hides functions from Java, they cannot be overridden in Java either (and when it comes to an <code>abstract</code> member, the calls then result into <code>AbstractMethodError</code>). Given that, can I use <code>@JvmSynthetic</code> to prohibit overriding members of a Kotlin class in Java sources?</p>