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