Skip to content

Commit 45a1775

Browse files
authored
Enumeration documentation: remove nested class shadowing in "override" position
1 parent eb525fd commit 45a1775

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

library/src/scala/Enumeration.scala

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,21 @@ import scala.util.matching.Regex
5656
* @example {{{
5757
* // Example of adding attributes to an enumeration by extending the Enumeration.Val class
5858
* object Planet extends Enumeration {
59-
* protected case class Val(mass: Double, radius: Double) extends super.Val {
59+
* protected case class PlanetVal(mass: Double, radius: Double) extends super.Val {
6060
* def surfaceGravity: Double = Planet.G * mass / (radius * radius)
6161
* def surfaceWeight(otherMass: Double): Double = otherMass * surfaceGravity
6262
* }
63-
* implicit def valueToPlanetVal(x: Value): Val = x.asInstanceOf[Val]
63+
* implicit def valueToPlanetVal(x: Value): PlanetVal = x.asInstanceOf[PlanetVal]
6464
*
6565
* val G: Double = 6.67300E-11
66-
* val Mercury = Val(3.303e+23, 2.4397e6)
67-
* val Venus = Val(4.869e+24, 6.0518e6)
68-
* val Earth = Val(5.976e+24, 6.37814e6)
69-
* val Mars = Val(6.421e+23, 3.3972e6)
70-
* val Jupiter = Val(1.9e+27, 7.1492e7)
71-
* val Saturn = Val(5.688e+26, 6.0268e7)
72-
* val Uranus = Val(8.686e+25, 2.5559e7)
73-
* val Neptune = Val(1.024e+26, 2.4746e7)
66+
* val Mercury = PlanetVal(3.303e+23, 2.4397e6)
67+
* val Venus = PlanetVal(4.869e+24, 6.0518e6)
68+
* val Earth = PlanetVal(5.976e+24, 6.37814e6)
69+
* val Mars = PlanetVal(6.421e+23, 3.3972e6)
70+
* val Jupiter = PlanetVal(1.9e+27, 7.1492e7)
71+
* val Saturn = PlanetVal(5.688e+26, 6.0268e7)
72+
* val Uranus = PlanetVal(8.686e+25, 2.5559e7)
73+
* val Neptune = PlanetVal(1.024e+26, 2.4746e7)
7474
* }
7575
*
7676
* println(Planet.values.filter(_.radius > 7.0e6))

0 commit comments

Comments
 (0)