Commit 545235a
committed
Refine typing of export forwarders
An export forwarder is now of singleton type only if the export path does not
refer to private values. Previously, this situation would lead to a type error
later on, like this one:
```scala
scala> class A{
| val x: Int = 1
| }
| class B(a: A){
| export a.x
| }
5 | export a.x
| ^
| non-private method x in class B refers to private value a
| in its type signature => (B.this.a.x : Int)
```1 parent fc29643 commit 545235a
File tree
3 files changed
+16
-3
lines changed- compiler/src/dotty/tools/dotc/typer
- docs/docs/reference/other-new-features
- tests/run
3 files changed
+16
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1088 | 1088 | | |
1089 | 1089 | | |
1090 | 1090 | | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
1091 | 1094 | | |
1092 | | - | |
| 1095 | + | |
1093 | 1096 | | |
1094 | 1097 | | |
1095 | 1098 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
47 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
0 commit comments