@@ -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
@@ -2232,7 +2226,6 @@ class Definitions {
22322226 orType,
22332227 RepeatedParamClass ,
22342228 ByNameParamClass2x ,
2235- AnyValClass ,
22362229 NullClass ,
22372230 NothingClass ,
22382231 SingletonClass ,
@@ -2538,51 +2531,6 @@ class Definitions {
25382531 | */
25392532 """ .stripMargin)
25402533
2541- add(AnyValClass ,
2542- """ /** `AnyVal` is the root class of all ''value types'', which describe values
2543- | * not implemented as objects in the underlying host system. Value classes
2544- | * are specified in Scala Language Specification, section 12.2.
2545- | *
2546- | * The standard implementation includes nine `AnyVal` subtypes:
2547- | *
2548- | * [[scala.Double]], [[scala.Float]], [[scala.Long]], [[scala.Int]], [[scala.Char]],
2549- | * [[scala.Short]], and [[scala.Byte]] are the ''numeric value types''.
2550- | *
2551- | * [[scala.Unit]] and [[scala.Boolean]] are the ''non-numeric value types''.
2552- | *
2553- | * Other groupings:
2554- | *
2555- | * - The ''subrange types'' are [[scala.Byte]], [[scala.Short]], and [[scala.Char]].
2556- | * - The ''integer types'' include the subrange types as well as [[scala.Int]] and [[scala.Long]].
2557- | * - The ''floating point types'' are [[scala.Float]] and [[scala.Double]].
2558- | *
2559- | * Prior to Scala 2.10, `AnyVal` was a sealed trait. Beginning with Scala 2.10,
2560- | * however, it is possible to define a subclass of `AnyVal` called a ''user-defined value class''
2561- | * which is treated specially by the compiler. Properly-defined user value classes provide a way
2562- | * to improve performance on user-defined types by avoiding object allocation at runtime, and by
2563- | * replacing virtual method invocations with static method invocations.
2564- | *
2565- | * User-defined value classes which avoid object allocation...
2566- | *
2567- | * - must have a single `val` parameter that is the underlying runtime representation.
2568- | * - can define `def`s, but no `val`s, `var`s, or nested `traits`s, `class`es or `object`s.
2569- | * - typically extend no other trait apart from `AnyVal`.
2570- | * - cannot be used in type tests or pattern matching.
2571- | * - may not override `equals` or `hashCode` methods.
2572- | *
2573- | * A minimal example:
2574- | * {{{
2575- | * class Wrapper(val underlying: Int) extends AnyVal {
2576- | * def foo: Wrapper = new Wrapper(underlying * 19)
2577- | * }
2578- | * }}}
2579- | *
2580- | * It's important to note that user-defined value classes are limited, and in some circumstances,
2581- | * still must allocate a value class instance at runtime. These limitations and circumstances are
2582- | * explained in greater detail in the [[https://docs.scala-lang.org/overviews/core/value-classes.html Value Classes and Universal Traits]].
2583- | */
2584- """ .stripMargin)
2585-
25862534 add(NullClass ,
25872535 """ /** `Null` is - together with [[scala.Nothing]] - at the bottom of the Scala type hierarchy.
25882536 | *
0 commit comments