title: Why is the no lateinit block in Kotlin?
body: <p>The following code is valid Kotlin code:</p>
  <pre class="lang-kotlin prettyprint-override"><code>abstract class A {
  
      protected lateinit var v: X
  
      abstract fun f(): X
  
      class SubA : A() {
          override fun f(): X {
              return SubX()
          }
  
          init {
              v = f()
          }
      }
  }
  </code></pre>
  <p>It defines an abstract class which has a <code>lateinit var</code> field and an abstract method that sets the value of that field. The reason behind this is that that method may be called later again, and its behavior should be defined in the subclasses that extend the original class.</p>
  <p>This code is a simplification of a real-world code, and even though it works, I feel like it is messy since the developer of the subclass could choose not to (or forget) to call <code>v = f()</code> inside an <code>init</code> block. And we cannot do that in <code>A</code> either because then it will show a warning that we are calling a non-final method in the constructor. What I propose is the following:</p>
  <pre class="lang-kotlin prettyprint-override"><code>abstract class A {
  
      private lateinit var v: X
  
      abstract fun f(): X
  
      class SubA : A() {
          override fun f(): X {
              return SubX()
          }
      }
  
      lateinit { // this does not exist
          v = f()
      }
  }
  </code></pre>
  <p>The benefits of this is that now the field can be <code>private</code> instead of <code>protected</code>, and the developer does not have to manually call <code>v = f()</code> in each of their subclasses (or the subclasses of their subclasses), and the naming fits with the nomenclature of Kotlin since <code>lateinit</code> is already a keyword and <code>init</code> is already a block. The only difference between an <code>init</code> and a <code>lateinit</code> block would be that the contents of a <code>lateinit</code> block are executed <em>after</em> the subclass constructors, not before like <code>init</code>.</p>
  <p>My question is, why isn't this a thing? Is this already possible with some other syntax that I do not know about? If not, do you think it's something that should be added to Kotlin? How and where can I make this suggestion so that the developers would most likely see it?</p>