From 5dce3252d7334e45a26c5b62a948b9f4d81758eb Mon Sep 17 00:00:00 2001 From: Chua Chee Seng Date: Wed, 3 Dec 2025 09:39:45 +0800 Subject: [PATCH 1/2] Updated scaladoc in ClassTag and FromDigits, fixing outdated contents and warnings. --- library/src/scala/reflect/ClassTag.scala | 22 ++++++++++------------ library/src/scala/util/FromDigits.scala | 6 +++--- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/library/src/scala/reflect/ClassTag.scala b/library/src/scala/reflect/ClassTag.scala index 1ebe2ed41196..24591af67a62 100644 --- a/library/src/scala/reflect/ClassTag.scala +++ b/library/src/scala/reflect/ClassTag.scala @@ -25,27 +25,25 @@ import scala.runtime.ClassValueCompat * field. This is particularly useful for instantiating `Array`s whose element types are unknown * at compile time. * - * `ClassTag`s are a weaker special case of [[scala.reflect.api.TypeTags.TypeTag]]s, in that they - * wrap only the runtime class of a given type, whereas a `TypeTag` contains all static type - * information. That is, `ClassTag`s are constructed from knowing only the top-level class of a - * type, without necessarily knowing all of its argument types. This runtime information is enough - * for runtime `Array` creation. + * `ClassTag`s wrap only the runtime class of a given type, without necessarily knowing all of + * its argument types. This runtime information is enough for runtime `Array` creation. * * For example: * {{{ - * scala> def mkArray[T : ClassTag](elems: T*) = Array[T](elems: _*) - * mkArray: [T](elems: T*)(implicit evidence\$1: scala.reflect.ClassTag[T])Array[T] + * scala> def mkArray[T : ClassTag](elems: T*) = Array[T](elems*) + * def mkArray[T](elems: T*)(using ClassTag[T]): Array[T] * * scala> mkArray(42, 13) - * res0: Array[Int] = Array(42, 13) + * val res0: Array[Int] = Array(42, 13) * * scala> mkArray("Japan","Brazil","Germany") - * res1: Array[String] = Array(Japan, Brazil, Germany) + * val res1: Array[String] = Array(Japan, Brazil, Germany) * }}} * - * See [[scala.reflect.api.TypeTags]] for more examples, or the - * [[https://docs.scala-lang.org/overviews/reflection/typetags-manifests.html Reflection Guide: TypeTags]] - * for more details. + * For compile-time type information in macros, see the facilities in the + * [[scala.quoted]] package. + * For limited runtime type checks beyond what `Class[_]` provides, see + * [[scala.reflect.Typeable]]. * */ @nowarn("""cat=deprecation&origin=scala\.reflect\.ClassManifestDeprecatedApis""") diff --git a/library/src/scala/util/FromDigits.scala b/library/src/scala/util/FromDigits.scala index 73b5a79b7546..47f534df039e 100644 --- a/library/src/scala/util/FromDigits.scala +++ b/library/src/scala/util/FromDigits.scala @@ -14,9 +14,9 @@ trait FromDigits[T] { * - sign `+` or `-` * - sequence of digits between 0 and 9 * - * @throws MalformedNumber if digit string is not legal for the given type - * @throws NumberTooLarge if value of result does not fit into `T`'s range - * @throws NumberTooSmall in case of numeric underflow (e.g. a non-zero + * @throws FromDigits.MalformedNumber if digit string is not legal for the given type + * @throws FromDigits.NumberTooLarge if value of result does not fit into `T`'s range + * @throws FromDigits.NumberTooSmall in case of numeric underflow (e.g. a non-zero * floating point literal that produces a zero value) */ def fromDigits(digits: String): T From db9cbe605239c410b2ea39b502141712177e761d Mon Sep 17 00:00:00 2001 From: Chua Chee Seng Date: Thu, 4 Dec 2025 10:29:22 +0800 Subject: [PATCH 2/2] Adjusted scaladoc as requested by @hamzaremmal . --- library/src/scala/reflect/ClassTag.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/src/scala/reflect/ClassTag.scala b/library/src/scala/reflect/ClassTag.scala index 24591af67a62..19b6316942e5 100644 --- a/library/src/scala/reflect/ClassTag.scala +++ b/library/src/scala/reflect/ClassTag.scala @@ -42,8 +42,8 @@ import scala.runtime.ClassValueCompat * * For compile-time type information in macros, see the facilities in the * [[scala.quoted]] package. - * For limited runtime type checks beyond what `Class[_]` provides, see - * [[scala.reflect.Typeable]]. + * For limited runtime type checks beyond what `Class[?]` provides, see + * [[scala.reflect.TypeTest]] and [[scala.reflect.Typeable]]. * */ @nowarn("""cat=deprecation&origin=scala\.reflect\.ClassManifestDeprecatedApis""")