Skip to content

Commit 2e3cc7b

Browse files
authored
Fix some of the scaladoc links (#295)
* Fix some of the scaladoc links If ones removes the line `Compile / doc / sources := Nil,` from the build and run `sbt doc` one get warnings like: ``` [warn] -- Warning: modules/deriving/src/main/scala/shapeless3/deriving/kinds.scala:66:7 [warn] 66 | type Kind[M <: Mirror, O <: Up] = (M of O) { type Kind = self.type } [warn] | ^ [warn] | Couldn't resolve a member for the given link query: Mirror ``` Based on the dicussion in scala/scala3#20028 my understanding is that this means that scaldoc can not resolve the existing link. The reason I want to fix this is that it will also show up for users implementing custom `Kinds`. E.g in some private project where I extends Kind I get warnings like this in my scaladoc: ``` [warn] -- Warning: modules/deriving/src/main/scala/shapeless3/deriving/kinds.scala:66:7 [warn] Couldn't resolve a member for the given link query: Mirror ``` (the error changed slighlty in the latest Scala 3 version). Since I don't think this is solvable for a user I suggest that we just make the links absolute which seems to solve the warnings. * No longer exclude all sources from scaladoc * Fix shapeless.Annotations links
1 parent 8e75af7 commit 2e3cc7b

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

build.sbt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ lazy val commonSettings = Seq(
141141
scalacOptions ++= Seq("-Werror", "-Yexplicit-nulls", "-deprecation"),
142142
Test / scalacOptions += "-Xmax-inlines:256",
143143
Test / scalacOptions -= "-Yexplicit-nulls",
144-
Compile / doc / sources := Nil,
145144
libraryDependencies += "com.github.sbt" % "junit-interface" % "0.13.3" % "test",
146145
testOptions += Tests.Argument(TestFrameworks.JUnit, "-a", "-s", "-v")
147146
)

modules/deriving/src/main/scala/shapeless3/deriving/annotation.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ object Annotations:
153153
*
154154
* }}}
155155
*
156-
* This implementation is based on [[shapeless.Annotations]] by Alexandre Archambault.
156+
* This implementation is based on `shapeless.Annotations` by Alexandre Archambault.
157157
*
158158
* @tparam A:
159159
* type annotation type
@@ -211,7 +211,7 @@ object TypeAnnotations:
211211
*
212212
* }}}
213213
*
214-
* This implementation is based on [[shapeless.Annotations]] by Alexandre Archambault.
214+
* This implementation is based on `shapeless.Annotations` by Alexandre Archambault.
215215
*
216216
* @tparam T:
217217
* product or sum type, whose fields or constructors are annotated
@@ -267,7 +267,7 @@ object AllAnnotations:
267267
*
268268
* }}}
269269
*
270-
* This implementation is based on [[shapeless.Annotations]] by Alexandre Archambault.
270+
* This implementation is based on `shapeless.Annotations` by Alexandre Archambault.
271271
*
272272
* @tparam T:
273273
* product or sum type, whose fields or constructors are annotated

modules/deriving/src/main/scala/shapeless3/deriving/kinds.scala

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,29 +55,29 @@ import scala.deriving.*
5555
trait Kind[Up <: AnyKind, Tup <: AnyKind, Mono[_ <: Up], Head[_ <: Tup] <: Up, Tail[_ <: Tup] <: Tup]:
5656
self =>
5757

58-
/** Similar to [[Mirror.Of]] but generalized to this kind. */
58+
/** Similar to [[scala.deriving.Mirror.Of]] but generalized to this kind. */
5959
infix type of[M <: Mirror, O <: Up] = M {
6060
type MirroredType = O
6161
type MirroredMonoType = Mono[O]
6262
type MirroredElemTypes <: Tup
6363
}
6464

65-
/** A [[Mirror]] for types of this kind, including the given scope of the enclosing object. */
65+
/** A [[scala.deriving.Mirror]] for types of this kind, including the given scope of the enclosing object. */
6666
type Kind[M <: Mirror, O <: Up] = (M of O) { type Kind = self.type }
6767

68-
/** A [[Mirror]] for types of this kind. */
68+
/** A [[scala.deriving.Mirror]] for types of this kind. */
6969
type Generic[O <: Up] = Kind[Mirror, O]
7070

71-
/** A [[Mirror.Product]] for types of this kind. */
71+
/** A [[scala.deriving.Mirror.Product]] for types of this kind. */
7272
type ProductGeneric[O <: Up] = Kind[Mirror.Product, O]
7373

74-
/** A [[Mirror.Sum]] for types of this kind. */
74+
/** A [[scala.deriving.Mirror.Sum]] for types of this kind. */
7575
type CoproductGeneric[O <: Up] = Kind[Mirror.Sum, O]
7676

7777
object Generic:
7878

7979
/**
80-
* Attaches the given scope of the enclosing object to a given [[Mirror]] as a type refinement.
80+
* Attaches the given scope of the enclosing object to a given [[scala.deriving.Mirror]] as a type refinement.
8181
*
8282
* The Scala compiler can automatically add type refinements to synthesized mirrors, but not to given mirrors in the
8383
* current scope or to user-defined mirrors. The scope of the enclosing object is necessary to resolve extension
@@ -126,16 +126,16 @@ trait Kind[Up <: AnyKind, Tup <: AnyKind, Mono[_ <: Up], Head[_ <: Tup] <: Up, T
126126
case _ *: _ => F[Head[T]] *: LiftP[F, Tail[T]]
127127
case _ => EmptyTuple
128128

129-
/** Given a [[Mirror]], provides instances of the type class `F` for all fields or variants of `T`. */
129+
/** Given a [[scala.deriving.Mirror]], provides instances of the type class `F` for all fields or variants of `T`. */
130130
inline given mkInstances[F[_ <: Up], T <: Up](using gen: Mirror of T): Instances[F, T] = inline gen match
131131
case given (Mirror.Product of T) => mkProductInstances[F, T]
132132
case given (Mirror.Sum of T) => mkCoproductInstances[F, T]
133133

134-
/** Given a [[Mirror.Product]], provides instances of the type class `F` for all fields of `T`. */
134+
/** Given a [[scala.deriving.Mirror.Product]], provides instances of the type class `F` for all fields of `T`. */
135135
inline given mkProductInstances[F[_ <: Up], T <: Up](using gen: Mirror.Product of T): ProductInstances[F, T] =
136136
ErasedProductInstances[self.type, F[T], LiftP[F, gen.MirroredElemTypes]](gen)
137137

138-
/** Given a [[Mirror.Sum]], provides instances of the type class `F` for all variants of `T`. */
138+
/** Given a [[scala.deriving.Mirror.Sum]], provides instances of the type class `F` for all variants of `T`. */
139139
inline given mkCoproductInstances[F[_ <: Up], T <: Up](using gen: Mirror.Sum of T): CoproductInstances[F, T] =
140140
ErasedCoproductInstances[self.type, F[T], LiftP[F, gen.MirroredElemTypes]](gen)
141141

0 commit comments

Comments
 (0)