Skip to content

Commit b717d20

Browse files
committed
Avoid using this.getClass in scripts function
1 parent ceea464 commit b717d20

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/test/dotty/tools/utils.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ import scala.util.control.{ControlThrowable, NonFatal}
1717

1818
import dotc.config.CommandLineParser
1919

20+
object Dummy
21+
2022
def scripts(path: String): Array[File] = {
21-
val dir = new File(this.getClass.getResource(path).getPath)
23+
val dir = new File(Dummy.getClass.getResource(path).getPath)
2224
assert(dir.exists && dir.isDirectory, "Couldn't load scripts dir")
2325
dir.listFiles.filter { f =>
2426
val path = if f.isDirectory then f.getPath + "/" else f.getPath

0 commit comments

Comments
 (0)