title: Kotlin: 'This type has a constructor and thus must be initialized here', but no constructor is declared
body: <p>Recently started with Kotlin</p>
  
  <p>According to Kotlin docs, there can be one primary constructor and one or more secondary constructor.</p>
  
  <p>I don't understand why I see this error
  <a href="https://i.stack.imgur.com/CFLKW.png" rel="noreferrer"><img src="https://i.stack.imgur.com/CFLKW.png" alt="enter image description here"></a></p>
  
  <p>Since class <code>test</code> has no primary constructor.</p>
  
  <p>This works fine:</p>
  
  <pre><code>open class test {
  }
  
  class test2 : test() {
  }
  </code></pre>
  
  <p>And here is another difficulty I have faced, when I define a secondary constructor the IDE shows another error saying </p>
  
  <blockquote>
    <p>Supertype initialization is impossible without primary constructor
    <a href="https://i.stack.imgur.com/0GlM7.png" rel="noreferrer"><img src="https://i.stack.imgur.com/0GlM7.png" alt="enter image description here"></a></p>
  </blockquote>
  
  <p>But in the previous working example, I did initialize it, yet it worked fine. What did I get wrong? </p>