How to inject primitive variables in Kotlin? : <p>I am using Dagger2 for DI in my Android app, and using this code for injecting classes into my Activity is fine:</p>

<pre><code>@field:[Inject ApplicationContext]
lateinit var context: Context
</code></pre>

<p>but, <code>lateinit</code> modifier is not allowed on primitive type properties in Kotlin (for instance <code>Boolean</code>), how can I do something like this?</p>

<pre><code>@field:[Inject Named("isDemo")]
lateinit var isDemo: Boolean
</code></pre>

<p>when I remove <code>lateinit</code> from this code I get this error <code>Dagger does not support injection into private fields</code></p>
