If I sprinkle a few typos in module-info.java, the...
# compiler
m
If I sprinkle a few typos in module-info.java, the compiler (via gradle) happily compiles anyway. Meanwhile IntelliJ complains about both the typo and (when the typo is removed) the usual JPMS issues — split packages in dependencies, etc
u
If there's a typo in module-info.java, the Kotlin compiler will not report any error. We also do not report errors about split packages in dependencies. This is expected because you will compile the same module with javac anyway (at least to obtain module-info.class) and see those errors. However we do report things like usages of non-exported elements from other modules, and even if module-info.java contains a typo, the compiler should recognize the non-erroneous parts of the same module-info (everything else that's parseable) and report these errors. If it doesn't, it's a bug.
m
Hmm... module-info.class isn't being generated. Do I need to separately apply the java plugin? I thought the kotlin plugin did that for me
u
Yes, the Kotlin compiler never compiles module-info.java into module-info.class. So depending on the build system you use, you may need to make sure the Java compiler is also being run on your module
m
Gradle, in this case
Looks like Gradle support is pretty much “roll it yourself” still: https://guides.gradle.org/building-java-9-modules/