Skip to content

Commit b82ab3a

Browse files
authored
Scaladoc Fix (#24636)
Updated scaladoc in ClassTag and FromDigits, fixing outdated contents and warnings.
2 parents 241f261 + db9cbe6 commit b82ab3a

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

library/src/scala/reflect/ClassTag.scala

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,25 @@ 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 macros, see the facilities in the
44+
* [[scala.quoted]] package.
45+
* For limited runtime type checks beyond what `Class[?]` provides, see
46+
* [[scala.reflect.TypeTest]] and [[scala.reflect.Typeable]].
4947
*
5048
*/
5149
@nowarn("""cat=deprecation&origin=scala\.reflect\.ClassManifestDeprecatedApis""")

library/src/scala/util/FromDigits.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ trait FromDigits[T] {
1414
* - sign `+` or `-`
1515
* - sequence of digits between 0 and 9
1616
*
17-
* @throws MalformedNumber if digit string is not legal for the given type
18-
* @throws NumberTooLarge if value of result does not fit into `T`'s range
19-
* @throws NumberTooSmall in case of numeric underflow (e.g. a non-zero
17+
* @throws FromDigits.MalformedNumber if digit string is not legal for the given type
18+
* @throws FromDigits.NumberTooLarge if value of result does not fit into `T`'s range
19+
* @throws FromDigits.NumberTooSmall in case of numeric underflow (e.g. a non-zero
2020
* floating point literal that produces a zero value)
2121
*/
2222
def fromDigits(digits: String): T

0 commit comments

Comments
 (0)