@@ -1595,7 +1595,7 @@ object Types {
1595
1595
* Assumes that symbols do not change between periods in the same run.
1596
1596
* Used to get the class underlying a ThisType.
1597
1597
*/
1598
- final private [Types ] def stableInRunSymbol (implicit ctx : Context ): Symbol = {
1598
+ private [Types ] def stableInRunSymbol (implicit ctx : Context ): Symbol = {
1599
1599
if (checkedPeriod.runId == ctx.runId) lastSymbol
1600
1600
else symbol
1601
1601
}
@@ -1689,10 +1689,10 @@ object Types {
1689
1689
d
1690
1690
}
1691
1691
1692
- def reloadDenot ()(implicit ctx : Context ) = // ### combine with invalidate(?)
1692
+ def reloadDenot ()(implicit ctx : Context ) =
1693
1693
setDenot(loadDenot(name, allowPrivate = ! symbol.exists || symbol.is(Private )))
1694
1694
1695
- protected def memberDenot (prefix : Type , name : Name , allowPrivate : Boolean )(implicit ctx : Context ): Denotation =
1695
+ private def memberDenot (prefix : Type , name : Name , allowPrivate : Boolean )(implicit ctx : Context ): Denotation =
1696
1696
if (allowPrivate) prefix.member(name) else prefix.nonPrivateMember(name)
1697
1697
1698
1698
private def disambiguate (d : Denotation )(implicit ctx : Context ): Denotation = {
@@ -1710,7 +1710,7 @@ object Types {
1710
1710
else d
1711
1711
}
1712
1712
1713
- private def setDenot (denot : Denotation )(implicit ctx : Context ): Unit = { // ### make private? (also others)
1713
+ private def setDenot (denot : Denotation )(implicit ctx : Context ): Unit = {
1714
1714
if (ctx.isAfterTyper)
1715
1715
assert(! denot.isOverloaded, this )
1716
1716
if (Config .checkNoDoubleBindings)
@@ -1759,8 +1759,10 @@ object Types {
1759
1759
|period = ${ctx.phase} at run ${ctx.runId}""" )
1760
1760
}
1761
1761
1762
- // ### make private or add comment
1763
- def infoDependsOnPrefix (symd : SymDenotation , prefix : Type )(implicit ctx : Context ): Boolean =
1762
+ /** A reference with the initial symbol in `symd` has an info that
1763
+ * might depend on the given prefix.
1764
+ */
1765
+ private def infoDependsOnPrefix (symd : SymDenotation , prefix : Type )(implicit ctx : Context ): Boolean =
1764
1766
symd.maybeOwner.membersNeedAsSeenFrom(prefix) && ! symd.is(NonMember )
1765
1767
1766
1768
/** Is this a reference to a class or object member? */
@@ -1889,11 +1891,11 @@ object Types {
1889
1891
case _ => withPrefix(prefix)
1890
1892
}
1891
1893
1892
- private [dotc] final def withSym (sym : Symbol )(implicit ctx : Context ): ThisType =
1894
+ final def withSym (sym : Symbol )(implicit ctx : Context ): ThisType =
1893
1895
if ((designator ne sym) && sym.exists) NamedType (prefix, sym).asInstanceOf [ThisType ]
1894
1896
else this
1895
1897
1896
- private [dotc] final def withDenot (denot : Denotation )(implicit ctx : Context ): ThisType =
1898
+ final def withDenot (denot : Denotation )(implicit ctx : Context ): ThisType =
1897
1899
if (denot.exists) {
1898
1900
val adapted = withSym(denot.symbol)
1899
1901
if (adapted ne this ) adapted.withDenot(denot).asInstanceOf [ThisType ]
@@ -3352,14 +3354,9 @@ object Types {
3352
3354
3353
3355
def appliedRef (implicit ctx : Context ): Type = {
3354
3356
def clsDenot = if (prefix eq cls.owner.thisType) cls.denot else cls.denot.copySymDenotation(info = this )
3355
- if (appliedRefCache == null ) {
3356
- val tref =
3357
- if ((cls is PackageClass ) || cls.owner.isTerm)
3358
- TypeRef (prefix, cls) // ### not always symbolicRef?
3359
- else TypeRef (prefix, cls.name, clsDenot)
3357
+ if (appliedRefCache == null )
3360
3358
appliedRefCache =
3361
- tref.appliedTo(cls.typeParams.map(_.typeRef))
3362
- }
3359
+ TypeRef (prefix, cls.name, clsDenot).appliedTo(cls.typeParams.map(_.typeRef))
3363
3360
appliedRefCache
3364
3361
}
3365
3362
0 commit comments