Dotty Documentation


class ExpandPrivate
extends MiniPhaseTransform with IdentityDenotTransformer

Make private term members that are accessed from another class non-private by resetting the Private flag and expanding their name.

Make private accessor in value class not-private. Ihis is necessary to unbox the value class when accessing it from separate compilation units

Also, make non-private any private parameter forwarders that forward to an inherited public or protected parameter accessor with the same name as the forwarder. This is necessary since private methods are not allowed to have the same name as inherited public ones.

See discussion in and

[-] Constructors

ExpandPrivate ( )

[-] Members

[+] override def checkPostCondition ( tree: Tree ) ( implicit ctx: Context ) : Unit

Check what the phase achieves, to be called at any point after it is finished.

[+] private def ensurePrivateAccessible ( d: SymDenotation ) ( implicit ctx: Context ) : Unit

Make private terms accessed from different classes non-private. Note: this happens also for accesses between class and linked module class. If we change the scheme at one point to make static module class computations static members of the companion class, we should tighten the condition below.

[+] private def isVCPrivateParamAccessor ( d: SymDenotation ) ( implicit ctx: Context ) : Boolean
[+] override def phaseName : String

A name given to the Phase that can be used to debug the compiler. For instance, it is possible to print trees after a given phase using:

$ ./bin/dotc -Xprint:<phaseNameHere> sourceFile.scala
[+] override def runsAfter : Set [ Class [ Nothing <: Phase ] ]

List of names of phases that should precede this phase

[+] override def transformDefDef ( tree: DefDef ) ( implicit ctx: Context , info: TransformerInfo ) : Tree
[+] override def transformIdent ( tree: Ident ) ( implicit ctx: Context , info: TransformerInfo ) : Tree
[+] override def transformSelect ( tree: Select ) ( implicit ctx: Context , info: TransformerInfo ) : Tree