Skip to content

Commit b8450a0

Browse files
committed
ScalaCompilerForUnitTesting: do not use structural types
Otherwise the test won't compile with dotty.
1 parent b6e3665 commit b8450a0

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

sbt-bridge/test/xsbt/ScalaCompilerForUnitTesting.scala

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -176,17 +176,7 @@ class ScalaCompilerForUnitTesting(nameHashing: Boolean, includeSynthToNameHashin
176176
import dotty.tools.dotc.{Compiler, Driver}
177177
import dotty.tools.dotc.core.Contexts._
178178

179-
val driver = new Driver {
180-
181-
protected def newCompiler(implicit ctx: Context): Compiler = new Compiler
182-
183-
override protected def sourcesRequired = false
184-
185-
def getCompiler(args: Array[String], rootCtx: Context) = {
186-
val (fileNames, ctx) = setup(args, rootCtx)
187-
(newCompiler(ctx), ctx)
188-
}
189-
}
179+
val driver = new TestDriver
190180
val ctx = (new ContextBase).initialCtx.fresh.setSbtCallback(analysisCallback)
191181
driver.getCompiler(Array("-classpath", classpath, "-usejavacp", "-d", outputDir.getAbsolutePath), ctx)
192182
}

sbt-bridge/test/xsbt/TestDriver.scala

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package xsbt
2+
3+
import dotty.tools.dotc._
4+
import core.Contexts._
5+
6+
class TestDriver extends Driver {
7+
protected def newCompiler(implicit ctx: Context): Compiler = new Compiler
8+
9+
override protected def sourcesRequired = false
10+
11+
def getCompiler(args: Array[String], rootCtx: Context) = {
12+
val (fileNames, ctx) = setup(args, rootCtx)
13+
(newCompiler(ctx), ctx)
14+
}
15+
}

0 commit comments

Comments
 (0)