File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
compiler/src/dotty/tools/dotc/util Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -233,7 +233,15 @@ object SourceFile {
233233 // As we already check that the prefix matches, the special handling for
234234 // Windows is not needed.
235235
236- refPath.relativize(sourcePath).toString
236+ // We also consistently use forward slashes as path element separators
237+ // for relative paths. If we didn't do that, it'd be impossible to parse
238+ // them back, as one would need to know whether they were created on Windows
239+ // and use both slashes as separators, or on other OS and use forward slash
240+ // as separator, backslash as file name character.
241+
242+ import scala .jdk .CollectionConverters ._
243+ val path = refPath.relativize(sourcePath)
244+ path.iterator.asScala.mkString(" /" )
237245 else
238246 sourcePath.toString
239247 }
You can’t perform that action at this time.
0 commit comments