Report warning for several modules with same name on module path

This commit is contained in:
Alexander Udalov
2017-06-30 21:00:52 +03:00
parent e8a8bdc58e
commit 51fb02b2d5
10 changed files with 52 additions and 9 deletions
@@ -0,0 +1,3 @@
package foo;
public class Foo {}
@@ -0,0 +1,3 @@
module dependency {
exports foo;
}
@@ -0,0 +1,3 @@
package bar;
public class Bar {}
@@ -0,0 +1,3 @@
module dependency {
exports bar;
}
@@ -0,0 +1,11 @@
compiler/testData/javaModules/severalModulesWithTheSameName/main/usage.kt:2:8: error: unresolved reference: bar
import bar.Bar
^
compiler/testData/javaModules/severalModulesWithTheSameName/main/usage.kt:6:12: error: unresolved reference: Bar
val b: Bar = Bar()
^
compiler/testData/javaModules/severalModulesWithTheSameName/main/usage.kt:6:18: error: unresolved reference: Bar
val b: Bar = Bar()
^
$TMP_DIR$/dependency2.jar: warning: the root is ignored because a module with the same name 'dependency' has been found earlier on the module path at: $TMP_DIR$/dependency1.jar
COMPILATION_ERROR
@@ -0,0 +1,3 @@
module main {
requires dependency;
}
@@ -0,0 +1,8 @@
import foo.Foo
import bar.Bar
fun usage(): String {
val f: Foo = Foo()
val b: Bar = Bar()
return "$f$b"
}