Skip to content

Properly detect conflicts on windows #13179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions scaladoc/src/dotty/tools/scaladoc/renderers/Resources.scala
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,9 @@ trait Resources(using ctx: DocContext) extends Locations, Writer:
)

def renderResource(resource: Resource): Seq[String] =
if resource.path.endsWith(".html") && apiPaths.contains(resource.path) then
report.error(s"Conflict between resource and API member for ${resource.path}. $pathsConflictResoultionMsg")
val normalizedPath = resource.path.replace('\\', '/')
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't be Paths.get(resource.path).toString more elegant in that case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It may still return representation with \\

if normalizedPath.endsWith(".html") && apiPaths.contains(normalizedPath) then
report.error(s"Conflict between resource and API member for $normalizedPath. $pathsConflictResoultionMsg")
Nil
else
resource match
Expand Down