Skip to content

Commit ed59a5b

Browse files
committed
Test source compiled twice
Test that an error message is issued for sources in different directories but with the same filename and package.
1 parent 609ef62 commit ed59a5b

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

compiler/test/dotty/tools/dotc/CompilationTests.scala

+5-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,11 @@ class CompilationTests extends ParallelTesting {
165165
compileFile("tests/neg-custom-args/i3627.scala", allowDeepSubtypes) +
166166
compileFile("tests/neg-custom-args/matchtype-loop.scala", allowDeepSubtypes) +
167167
compileFile("tests/neg-custom-args/completeFromSource/nested/Test1.scala", defaultOptions.and("-sourcepath", "tests/neg-custom-args", "-scansource")) +
168-
compileFile("tests/neg-custom-args/repeatedArgs213.scala", defaultOptions.and("-Ynew-collections"))
168+
compileFile("tests/neg-custom-args/repeatedArgs213.scala", defaultOptions.and("-Ynew-collections")) +
169+
compileList("duplicate source", List(
170+
"tests/neg-custom-args/toplevel-samesource/S.scala",
171+
"tests/neg-custom-args/toplevel-samesource/nested/S.scala"),
172+
defaultOptions)
169173
}.checkExpectedErrors()
170174

171175
@Test def fuzzyAll: Unit = {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
package p
2+
val a = 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
package p
2+
val b = 2 // error: package object S$package in package p has already been compiled once during this run

0 commit comments

Comments
 (0)