KAPT: Omit property initializers for non const properties in stubs
I have not be able to identity any issues with omitting the initializer in the stub even though javac could theoretically complain since they need a value assigned.
If this is a concern there are two other solutions:
- Omit the initializer at the declaration site and move it to the constructor or an initializer block.
- Wrap primitive values in
Boolean.valueOf,Integer.valueOfetc.
- This solution still needs a solution for
String?properties that are set tonull.
I'd also like to discuss whether properties that are not const but still have a known fixed value at compile time (val foo = 1 for example) should have their values omitted or not. With the initial implementation all non const properties omit the initializer.
Ok, I feel pretty happy about this now. Now only constructor parameters are affected and only primitives/strings.
There is a special case for interfaces as it seems that static interface fields require an initializer. We could perhaps use the wrapper approach for those.