3 ms·
Agreed. If you need to find out if a lateinit field has actually been initialized, and you aren't writing a library that is responsible for initializing it, tha
by afastow 10y ago
Agreed. If you need to find out if a lateinit field has actually been initialized, and you aren't writing a library that is responsible for initializing it, that means your field is really nullable so just mark it as such.
If you are writing a library I think you should be able to use reflection to figure out if it has actually been initialized, or worst case scenario just catch the exception that is thrown if it isn't initialized.