Skip to content

Commit 10ae0c3

Browse files
Add more details page on Class Shadowing
1 parent 8b4f0fa commit 10ae0c3

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
layout: doc-page
3+
title: "Dropped: Class Shadowing - More Details"
4+
---
5+
6+
Spec diff: in section [5.1.4 Overriding](https://www.scala-lang.org/files/archive/spec/2.12/05-classes-and-objects.html), add *M' must not be a class*.
7+
8+
> Why do we want to make this change to the language?
9+
10+
tbd
11+
12+
13+
> How much existing code is going to be affected?
14+
15+
From all the code compiled so far with Dotty 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.
16+
17+
18+
> How exactly is existing code going to be affected?
19+
20+
Code that relies on overridden inner classes will stop compiling.
21+
22+
23+
> Is this change going to be migratable automatically?
24+
25+
No.

docs/docs/reference/dropped/class-shadowing.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,4 @@ other, but classes in Scala cannot be overridden. To keep things clean
2424
(and its internal operations consistent) the Dotty compiler forces you
2525
to rename the inner classes so that their names are different.
2626

27-
28-
29-
27+
[More details](./class-shadowing-spec.html)

0 commit comments

Comments
 (0)