@@ -283,13 +283,7 @@ class Definitions {
283283 def AnyType : TypeRef = AnyClass .typeRef
284284 @ tu lazy val MatchableClass : ClassSymbol = completeClass(enterCompleteClassSymbol(ScalaPackageClass , tpnme.Matchable , Trait | TransparentType , AnyType :: Nil ), ensureCtor = false )
285285 def MatchableType : TypeRef = MatchableClass .typeRef
286- @ tu lazy val AnyValClass : ClassSymbol =
287- val res = completeClass(enterCompleteClassSymbol(ScalaPackageClass , tpnme.AnyVal , Abstract | TransparentType , List (AnyType , MatchableType )))
288- // Mark companion as absent, so that class does not get re-completed
289- val companion = ScalaPackageVal .info.decl(nme.AnyVal ).symbol
290- companion.moduleClass.markAbsent()
291- companion.markAbsent()
292- res
286+ @ tu lazy val AnyValClass : ClassSymbol = requiredClass(" scala.AnyVal" )
293287
294288 def AnyValType : TypeRef = AnyValClass .typeRef
295289
@@ -2231,7 +2225,6 @@ class Definitions {
22312225 orType,
22322226 RepeatedParamClass ,
22332227 ByNameParamClass2x ,
2234- AnyValClass ,
22352228 NullClass ,
22362229 NothingClass ,
22372230 SingletonClass ,
@@ -2537,51 +2530,6 @@ class Definitions {
25372530 | */
25382531 """ .stripMargin)
25392532
2540- add(AnyValClass ,
2541- """ /** `AnyVal` is the root class of all ''value types'', which describe values
2542- | * not implemented as objects in the underlying host system. Value classes
2543- | * are specified in Scala Language Specification, section 12.2.
2544- | *
2545- | * The standard implementation includes nine `AnyVal` subtypes:
2546- | *
2547- | * [[scala.Double]], [[scala.Float]], [[scala.Long]], [[scala.Int]], [[scala.Char]],
2548- | * [[scala.Short]], and [[scala.Byte]] are the ''numeric value types''.
2549- | *
2550- | * [[scala.Unit]] and [[scala.Boolean]] are the ''non-numeric value types''.
2551- | *
2552- | * Other groupings:
2553- | *
2554- | * - The ''subrange types'' are [[scala.Byte]], [[scala.Short]], and [[scala.Char]].
2555- | * - The ''integer types'' include the subrange types as well as [[scala.Int]] and [[scala.Long]].
2556- | * - The ''floating point types'' are [[scala.Float]] and [[scala.Double]].
2557- | *
2558- | * Prior to Scala 2.10, `AnyVal` was a sealed trait. Beginning with Scala 2.10,
2559- | * however, it is possible to define a subclass of `AnyVal` called a ''user-defined value class''
2560- | * which is treated specially by the compiler. Properly-defined user value classes provide a way
2561- | * to improve performance on user-defined types by avoiding object allocation at runtime, and by
2562- | * replacing virtual method invocations with static method invocations.
2563- | *
2564- | * User-defined value classes which avoid object allocation...
2565- | *
2566- | * - must have a single `val` parameter that is the underlying runtime representation.
2567- | * - can define `def`s, but no `val`s, `var`s, or nested `traits`s, `class`es or `object`s.
2568- | * - typically extend no other trait apart from `AnyVal`.
2569- | * - cannot be used in type tests or pattern matching.
2570- | * - may not override `equals` or `hashCode` methods.
2571- | *
2572- | * A minimal example:
2573- | * {{{
2574- | * class Wrapper(val underlying: Int) extends AnyVal {
2575- | * def foo: Wrapper = new Wrapper(underlying * 19)
2576- | * }
2577- | * }}}
2578- | *
2579- | * It's important to note that user-defined value classes are limited, and in some circumstances,
2580- | * still must allocate a value class instance at runtime. These limitations and circumstances are
2581- | * explained in greater detail in the [[https://docs.scala-lang.org/overviews/core/value-classes.html Value Classes and Universal Traits]].
2582- | */
2583- """ .stripMargin)
2584-
25852533 add(NullClass ,
25862534 """ /** `Null` is - together with [[scala.Nothing]] - at the bottom of the Scala type hierarchy.
25872535 | *
0 commit comments