Skip to content

Commit b758f7d

Browse files
committed
Fix rewrite test: -source 3.0-migrate does not imply noindent
The code might have been rewritten with `-indent`, but still needs to compile in scala2compat mode.
1 parent 1298965 commit b758f7d

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

compiler/src/dotty/tools/dotc/parsing/Scanners.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ object Scanners {
197197
val noindentSyntax =
198198
ctx.settings.noindent.value
199199
|| ctx.settings.oldSyntax.value
200-
|| migrateTo3
201200
val indentSyntax =
202201
((if (Config.defaultIndent) !noindentSyntax else ctx.settings.indent.value)
203202
|| rewriteNoIndent)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class CompilationTests extends ParallelTesting {
7171
implicit val testGroup: TestGroup = TestGroup("rewrites")
7272

7373
aggregateTests(
74-
// compileFile("tests/rewrites/rewrites.scala", scala2CompatMode.and("-rewrite")),
74+
compileFile("tests/rewrites/rewrites.scala", scala2CompatMode.and("-rewrite", "-indent")),
7575
compileFile("tests/rewrites/i8982.scala", defaultOptions.and("-indent").and("-rewrite"))
7676
).checkRewrites()
7777
}

compiler/test/dotty/tools/vulpix/ParallelTesting.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ trait ParallelTesting extends RunnerOrchestration { self =>
8181
else self
8282
}
8383

84+
def withoutFlags(flags1: String*): TestSource = self match {
85+
case self: JointCompilationSource =>
86+
self.copy(flags = flags.without(flags1: _*))
87+
case self: SeparateCompilationSource =>
88+
self.copy(flags = flags.without(flags1: _*))
89+
}
90+
8491
/** Generate the instructions to redo the test from the command line */
8592
def buildInstructions(errors: Int, warnings: Int): String = {
8693
val sb = new StringBuilder

0 commit comments

Comments
 (0)