File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
src/dotty/tools/dotc/transform Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ package dotty.tools.dotc
2
2
package transform
3
3
4
4
import core ._
5
- import DenotTransformers .IdentityDenotTransformer
5
+ import dotty . tools . dotc . core . DenotTransformers .{ SymTransformer , IdentityDenotTransformer }
6
6
import Contexts .Context
7
7
import Symbols ._
8
8
import Scopes ._
@@ -16,14 +16,23 @@ import Decorators._
16
16
import ast .Trees ._
17
17
import TreeTransforms ._
18
18
19
- /** Make private term members accessed from other classes non-private
20
- * by resetting the Private flag and expanding their name.
19
+ /** Make private term members that are:
20
+ * - accessed from another class
21
+ * - deferred
22
+ * non-private by resetting the Private flag and expanding their name.
21
23
*/
22
- class ExpandPrivate extends MiniPhaseTransform with IdentityDenotTransformer { thisTransform =>
24
+ class ExpandPrivate extends MiniPhaseTransform with SymTransformer { thisTransform =>
23
25
import ast .tpd ._
24
26
25
27
override def phaseName : String = " expandPrivate"
26
28
29
+
30
+ def transformSym (sym : SymDenotation )(implicit ctx : Context ): SymDenotation = {
31
+ if (sym.is(Method ) && sym.is(Deferred ))
32
+ sym.ensureNotPrivate
33
+ else sym
34
+ }
35
+
27
36
/** Make private terms accessed from different classes non-private.
28
37
* Note: this happens also for accesses between class and linked module class.
29
38
* If we change the scheme at one point to make static module class computations
You can’t perform that action at this time.
0 commit comments