Darryl Miles
12/17/2023, 11:33 AMlateinit
to confirm they have an expected injection annotation on the field, and maybe warn if the field is left public.
Maybe there is also the ability to put the plugin in debug build mode and it will insert implicit call to assertion check of all lateinit
at runtime maybe at the end of all constructors such as constructor() { myBusinessLogicMethodCall(); injectedKotlinLateInitInjectionChecker() }
and a method inserted like private fun injectedKotlinLateInitInjectionChecker() { assert((FieldType?)fieldName != null) {"injected Kotlin lateinit usage check failed on field: fieldName"} }
Tim Schraepen
12/23/2023, 6:02 AMlateinit var
field injection points. Then you would simply use the compiler to check those collaborating classes are “injected”.Darryl Miles
01/17/2024, 5:05 AM@InstrumentThisMethodWithLateInitChecks void injectedKotlinLateInitInjectionChecker() { }
then such a plugin would replace/wrap and edit bytecode