title: Kotlin: How to inherit property in data class
body: <p>I have abstract Token class declared like this:</p>
  
  <pre><code>abstract class Token(var index: Int = 0) {
  open fun merge(toMerge: Token): Token? {
      return null
      }
  }
  </code></pre>
  
  <p>I want to inherit index property in data class, like this:</p>
  
  <pre><code>data class CloseLoop(index: Int, var openLoopIndex: Int = 0) : Token(index)
  </code></pre>
  
  <p>But it gives me error <code>Data class primary constructor must have only property (val / var) parameters</code></p>
  
  <p>What i have to do to fix this?</p>