allow `lateinit` for properties of non-primitive i...
# language-proposals
l
allow
lateinit
for properties of non-primitive inline/value types
Copy code
@JvmInline
value class Id(val value: String)

class MyClass {
	lateinit var id1: String //this is fine
	lateinit var id2: Id //so this should be too
}
also as a workaround,
Copy code
var id2: Id by Delegates.notNull()
a
Isn't that code a suggestion by Intellij ?
l
is there an equivalent of
isInitialized
for that workaround?
so in theory yes it could, but even with reflected access to the delegate,
Delegates.notNull
doesn't expose that information
if you made your own wrapper such as this, it's doable (although not very ergonomic):