Use module path instead of class path for stdlib on Java 9

Also report the "named does not read unnamed" error, which was not
possible previously because we wouldn't be able to read anything from
kotlin-stdlib (because it was added to the unnamed module by default)
This commit is contained in:
Alexander Udalov
2017-07-07 18:25:06 +03:00
parent c94b21edd5
commit 03a6488464
16 changed files with 118 additions and 37 deletions
@@ -68,9 +68,7 @@ class JvmModuleAccessibilityChecker(project: Project) : CallChecker {
return when (diagnostic) {
is ModuleDoesNotReadUnnamedModule ->
// TODO: report this error as soon as module path is used instead of class path for modular compilation
// JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE.on(reportOn)
null
JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE.on(reportOn)
is ModuleDoesNotReadModule ->
JAVA_MODULE_DOES_NOT_DEPEND_ON_MODULE.on(reportOn, diagnostic.dependencyModuleName)
is ModuleDoesNotExportPackage ->
@@ -74,7 +74,8 @@ class JavaModuleInfo(
}
override fun visitExport(packageFqName: String, access: Int, modules: Array<String>?) {
exports.add(Exports(FqName(packageFqName), modules?.toList().orEmpty()))
// For some reason, '/' is the delimiter in packageFqName here
exports.add(Exports(FqName(packageFqName.replace('/', '.')), modules?.toList().orEmpty()))
}
}
}