Skip to content

Commit 471b6c4

Browse files
committed
Fixed outdated scaladoc for ClassTag causing warning when building scaladoc.
1 parent 3c33271 commit 471b6c4

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

library/src/scala/reflect/ClassTag.scala

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,24 @@ import scala.runtime.ClassValueCompat
2525
* field. This is particularly useful for instantiating `Array`s whose element types are unknown
2626
* at compile time.
2727
*
28-
* `ClassTag`s are a weaker special case of [[scala.reflect.api.TypeTags.TypeTag]]s, in that they
29-
* wrap only the runtime class of a given type, whereas a `TypeTag` contains all static type
30-
* information. That is, `ClassTag`s are constructed from knowing only the top-level class of a
31-
* type, without necessarily knowing all of its argument types. This runtime information is enough
32-
* for runtime `Array` creation.
28+
* `ClassTag`s wrap only the runtime class of a given type, without necessarily knowing all of
29+
* its argument types. This runtime information is enough for runtime `Array` creation.
3330
*
3431
* For example:
3532
* {{{
36-
* scala> def mkArray[T : ClassTag](elems: T*) = Array[T](elems: _*)
37-
* mkArray: [T](elems: T*)(implicit evidence\$1: scala.reflect.ClassTag[T])Array[T]
33+
* scala> def mkArray[T : ClassTag](elems: T*) = Array[T](elems*)
34+
* def mkArray[T](elems: T*)(using ClassTag[T]): Array[T]
3835
*
3936
* scala> mkArray(42, 13)
40-
* res0: Array[Int] = Array(42, 13)
37+
* val res0: Array[Int] = Array(42, 13)
4138
*
4239
* scala> mkArray("Japan","Brazil","Germany")
43-
* res1: Array[String] = Array(Japan, Brazil, Germany)
40+
* val res1: Array[String] = Array(Japan, Brazil, Germany)
4441
* }}}
4542
*
46-
* See [[scala.reflect.api.TypeTags]] for more examples, or the
47-
* [[https://docs.scala-lang.org/overviews/reflection/typetags-manifests.html Reflection Guide: TypeTags]]
48-
* for more details.
43+
* For compile-time type information in metaprogramming, see [[scala.quoted.Type]].
44+
* For runtime type information beyond class erasure, see [[scala.reflect.Typeable]].
45+
* For type-class derivation, see [[scala.deriving.Mirror]].
4946
*
5047
*/
5148
@nowarn("""cat=deprecation&origin=scala\.reflect\.ClassManifestDeprecatedApis""")

0 commit comments

Comments
 (0)