diff --git a/docs/_spec/05-classes-and-objects.md b/docs/_spec/05-classes-and-objects.md index 622f9dc8ae59..c40bd49cae16 100644 --- a/docs/_spec/05-classes-and-objects.md +++ b/docs/_spec/05-classes-and-objects.md @@ -241,7 +241,7 @@ It inherits member `f` from trait `C` and member `g` from trait `B`. A member ´M´ of class ´C´ that [matches](#class-members) a non-private member ´M'´ of a base class of ´C´ is said to _override_ that member. In this case the binding of the overriding member ´M´ must [subsume](03-types.html#conformance) the binding of the overridden member ´M'´. Furthermore, the following restrictions on modifiers apply to ´M´ and ´M'´: - +- ´M'´ must not be a class. - ´M'´ must not be labeled `final`. - ´M´ must not be [`private`](#modifiers). - If ´M´ is labeled `private[´C´]` for some enclosing class or package ´C´, then ´M'´ must be labeled `private[´C'´]` for some class or package ´C'´ where ´C'´ equals ´C´ or ´C'´ is contained in ´C´. diff --git a/docs/_spec/TODOreference/dropped-features/class-shadowing.md b/docs/_spec/APPLIEDreference/dropped-features/class-shadowing.md similarity index 100% rename from docs/_spec/TODOreference/dropped-features/class-shadowing.md rename to docs/_spec/APPLIEDreference/dropped-features/class-shadowing.md diff --git a/docs/_spec/TODOreference/dropped-features/class-shadowing-spec.md b/docs/_spec/TODOreference/dropped-features/class-shadowing-spec.md deleted file mode 100644 index 6c81087408c6..000000000000 --- a/docs/_spec/TODOreference/dropped-features/class-shadowing-spec.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -layout: doc-page -title: "Dropped: Class Shadowing - More Details" -nightlyOf: https://docs.scala-lang.org/scala3/reference/dropped-features/class-shadowing-spec.html ---- - -Spec diff: in section [5.1.4 Overriding](https://www.scala-lang.org/files/archive/spec/2.13/05-classes-and-objects.html#Overriding), add *M' must not be a class*. - -> Why do we want to make this change to the language? - -Class shadowing is irregular compared to other types of overrides. Indeed, inner classes are not actually overridden but simply shadowed. - - -> How much existing code is going to be affected? - -From all the code compiled so far with Scala 3 the only instance of this I could find is in the stdlib. Looking at [this commit](https://github.com/lampepfl/scala/commit/68f13bf39979b631ed211ec1751934306ceb5d6c#diff-7aa508b70e055b47c823764e3e5646b8) it seems like the usage of class shadowing was accidental. - - -> How exactly is existing code going to be affected? - -Code that relies on overridden inner classes will stop compiling. - - -> Is this change going to be migratable automatically? - -No.