File tree Expand file tree Collapse file tree 2 files changed +5
-11
lines changed
src/dotty/tools/dotc/transform Expand file tree Collapse file tree 2 files changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -16,23 +16,14 @@ import Decorators._
16
16
import ast .Trees ._
17
17
import TreeTransforms ._
18
18
19
- /** Make private term members that are:
20
- * - accessed from another class
21
- * - deferred
19
+ /** Make private term members that are accessed from another class
22
20
* non-private by resetting the Private flag and expanding their name.
23
21
*/
24
- class ExpandPrivate extends MiniPhaseTransform with SymTransformer { thisTransform =>
22
+ class ExpandPrivate extends MiniPhaseTransform with IdentityDenotTransformer { thisTransform =>
25
23
import ast .tpd ._
26
24
27
25
override def phaseName : String = " expandPrivate"
28
26
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
-
36
27
/** Make private terms accessed from different classes non-private.
37
28
* Note: this happens also for accesses between class and linked module class.
38
29
* If we change the scheme at one point to make static module class computations
Original file line number Diff line number Diff line change @@ -80,6 +80,9 @@ class TreeChecker extends Phase with SymTransformer {
80
80
testDuplicate(sym, seenClasses, " class" )
81
81
}
82
82
83
+ if (sym.is(Method ) && sym.is(Deferred ) && sym.is(Private ))
84
+ assert(false , s " $sym is both Deferred and Private " )
85
+
83
86
checkCompanion(symd)
84
87
85
88
symd
You can’t perform that action at this time.
0 commit comments