Skip to content

Commit a1ce896

Browse files
committed
Fix #15055
1 parent b1f00a7 commit a1ce896

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/dotty/tools/io/VirtualFile.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ package dotty.tools.io
77

88
import scala.language.unsafeNulls
99

10-
import java.io.{ ByteArrayInputStream, ByteArrayOutputStream, InputStream, OutputStream }
10+
import java.io.{ ByteArrayInputStream, ByteArrayOutputStream, InputStream, OutputStream, File }
1111

1212
/** This class implements an in-memory file.
1313
*
@@ -106,5 +106,5 @@ class VirtualFile(val name: String, override val path: String) extends AbstractF
106106
}
107107
object VirtualFile:
108108
private def nameOf(path: String): String =
109-
val i = path.lastIndexOf('/')
109+
val i = path.lastIndexOf(File.separator)
110110
if i >= 0 && i < path.length - 1 then path.substring(i + 1) else path

0 commit comments

Comments
 (0)