I have an idea I’d like to try to implement, but first I’d like to hear some feedback. It’s about adding nullability meta-data to JDK classes and possibly other libraries so we get rid of some platform types. It consists of three steps
- Get the meta-data. First, we have to figure out which parameters and return types in JDK libraries are (non)nullable. There are tools for that, I suppose they do not work perfectly, but I guess we can get some semiautomatic process going. In the worst case, we can crowd-source it.
- Store the meta-data. In the ideal world we would just add @Nullable annotations to the OpenJDK, but I’m afraid it’s not feasible for multiple reasons. But we can store the meta-data in an external format (something like typescript type information)
- Integrate the external format to Kotlin toolchain.
I think that all the steps are far from trivial but feasible. What do you think?