Skip to content

Commit

Permalink
changing docs to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelsadlo committed Sep 6, 2024
1 parent 4eccdb4 commit 300f198
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions os/src/Path.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ trait PathChunk {
}
trait ViewBoundImplicit {

/** macros are not avaliable as implicit views, so this is needed for [[os.PathChunk.ArrayPathChunk]] to work */
implicit def validatedStringFun(s: String): PathChunk = new PathChunk.StringPathChunkInternal(s)
// fallback to non-macro String => PathChunk implicit conversion in case eta expansion is needed, this is required for ArrayPathChunk and SeqPathChunk
implicit def validatedStringFunction(s: String): PathChunk =
new PathChunk.StringPathChunkInternal(s)
}

object PathChunk extends PathChunkMacros {
Expand All @@ -37,7 +38,7 @@ object PathChunk extends PathChunkMacros {
override def toString() = r.toString
}

/** this needed for usages of [[/]] inside this project, as we cannot use macros in same compilation unit */
// Implicit String => PathChunk conversion used inside os-lib, prevents macro expansion in same compilation unit
private[os] implicit class StringPathChunkInternal(s: String) extends PathChunk {
BasePath.checkSegment(s)
def segments = Seq(s)
Expand Down

0 comments on commit 300f198

Please sign in to comment.