Delayed Init of Primitives

lateinit modifier is not allowed on properties of primitive types.

Iā€™m trying to define

private lateinit var shader: Int

which results in the error above.

The solution is to use Delegates.notNull<>() which turns the property into a non-primitive type but the behaviour is the same.