Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/util/SourceFile.scala
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ object SourceFile {
val path = refPath.relativize(sourcePath)
path.iterator.asScala.mkString("/")
else
sourcePath.toString
jpath.toString
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The scaladoc says:

It returns the absolute path of `source` if it is not contained in `reference`.

By returning jpath instead of sourcePath when sourcePath.startsWith(refPath) == false breaks the contract in the documentation.

}

/** Return true if file is a script:
Expand Down
Loading