title: IntelliJ can't find Spring bean from Kotlin object
body: <p>I have a Spring Boot 2 + Kotlin application opened with IntelliJ 2019.1.</p>
  
  <p>In this application I annotate some Kotlin objects with <code>@Component</code>. Example:</p>
  
  <pre><code>@Component
  object MyObject: MyInterface {
      // code
  }
  </code></pre>
  
  <p>I have many different implementation of <code>MyInterface</code> (all with Kotlin objects) and I want to inject all of them in a list in another bean. Example:</p>
  
  <pre><code>@Component
  class MyComponent @Autowired constructor(private val objects: List&lt;MyInterface&gt;) {
      // code
  }
  </code></pre>
  
  <p>The code runs correctly (the beans are inject in the list <code>objects</code>) but IntelliJ shows an error saying:</p>
  
  <blockquote>
    <p>Could not autowire. No beans of '? extends MyInterface' or 'List&lt;? extends MyInterface>' types found.</p>
  </blockquote>
  
  <p>If I change 'object' to 'class' at 'MyObject', the error disappears.</p>
  
  <p>My questions are:</p>
  
  <ul>
  <li>Is it a problem with IntelliJ?</li>
  <li>Is it not recommended to annotate Kotlin objects with <code>@Component</code>?</li>
  </ul>