Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions library/src/scala/reflect/ClassTag.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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.TypeTest]] and [[scala.reflect.Typeable]].
*
*/
@nowarn("""cat=deprecation&origin=scala\.reflect\.ClassManifestDeprecatedApis""")
Expand Down
6 changes: 3 additions & 3 deletions library/src/scala/util/FromDigits.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading