@@ -1604,7 +1604,7 @@ object Types {
1604
1604
* Assumes that symbols do not change between periods in the same run.
1605
1605
* Used to get the class underlying a ThisType.
1606
1606
*/
1607
- final private [Types ] def stableInRunSymbol (implicit ctx : Context ): Symbol = {
1607
+ private [Types ] def stableInRunSymbol (implicit ctx : Context ): Symbol = {
1608
1608
if (checkedPeriod.runId == ctx.runId) lastSymbol
1609
1609
else symbol
1610
1610
}
@@ -1698,10 +1698,10 @@ object Types {
1698
1698
d
1699
1699
}
1700
1700
1701
- def reloadDenot ()(implicit ctx : Context ) = // ### combine with invalidate(?)
1701
+ def reloadDenot ()(implicit ctx : Context ) =
1702
1702
setDenot(loadDenot(name, allowPrivate = ! symbol.exists || symbol.is(Private )))
1703
1703
1704
- protected def memberDenot (prefix : Type , name : Name , allowPrivate : Boolean )(implicit ctx : Context ): Denotation =
1704
+ private def memberDenot (prefix : Type , name : Name , allowPrivate : Boolean )(implicit ctx : Context ): Denotation =
1705
1705
if (allowPrivate) prefix.member(name) else prefix.nonPrivateMember(name)
1706
1706
1707
1707
private def disambiguate (d : Denotation )(implicit ctx : Context ): Denotation = {
@@ -1719,7 +1719,7 @@ object Types {
1719
1719
else d
1720
1720
}
1721
1721
1722
- private def setDenot (denot : Denotation )(implicit ctx : Context ): Unit = { // ### make private? (also others)
1722
+ private def setDenot (denot : Denotation )(implicit ctx : Context ): Unit = {
1723
1723
if (ctx.isAfterTyper)
1724
1724
assert(! denot.isOverloaded, this )
1725
1725
if (Config .checkNoDoubleBindings)
@@ -1768,8 +1768,10 @@ object Types {
1768
1768
|period = ${ctx.phase} at run ${ctx.runId}""" )
1769
1769
}
1770
1770
1771
- // ### make private or add comment
1772
- def infoDependsOnPrefix (symd : SymDenotation , prefix : Type )(implicit ctx : Context ): Boolean =
1771
+ /** A reference with the initial symbol in `symd` has an info that
1772
+ * might depend on the given prefix.
1773
+ */
1774
+ private def infoDependsOnPrefix (symd : SymDenotation , prefix : Type )(implicit ctx : Context ): Boolean =
1773
1775
symd.maybeOwner.membersNeedAsSeenFrom(prefix) && ! symd.is(NonMember )
1774
1776
1775
1777
/** Is this a reference to a class or object member? */
@@ -1898,11 +1900,11 @@ object Types {
1898
1900
case _ => withPrefix(prefix)
1899
1901
}
1900
1902
1901
- private [dotc] final def withSym (sym : Symbol )(implicit ctx : Context ): ThisType =
1903
+ final def withSym (sym : Symbol )(implicit ctx : Context ): ThisType =
1902
1904
if ((designator ne sym) && sym.exists) NamedType (prefix, sym).asInstanceOf [ThisType ]
1903
1905
else this
1904
1906
1905
- private [dotc] final def withDenot (denot : Denotation )(implicit ctx : Context ): ThisType =
1907
+ final def withDenot (denot : Denotation )(implicit ctx : Context ): ThisType =
1906
1908
if (denot.exists) {
1907
1909
val adapted = withSym(denot.symbol)
1908
1910
if (adapted ne this ) adapted.withDenot(denot).asInstanceOf [ThisType ]
@@ -3379,14 +3381,9 @@ object Types {
3379
3381
3380
3382
def appliedRef (implicit ctx : Context ): Type = {
3381
3383
def clsDenot = if (prefix eq cls.owner.thisType) cls.denot else cls.denot.copySymDenotation(info = this )
3382
- if (appliedRefCache == null ) {
3383
- val tref =
3384
- if ((cls is PackageClass ) || cls.owner.isTerm)
3385
- TypeRef (prefix, cls) // ### not always symbolicRef?
3386
- else TypeRef (prefix, cls.name, clsDenot)
3384
+ if (appliedRefCache == null )
3387
3385
appliedRefCache =
3388
- tref.appliedTo(cls.typeParams.map(_.typeRef))
3389
- }
3386
+ TypeRef (prefix, cls.name, clsDenot).appliedTo(cls.typeParams.map(_.typeRef))
3390
3387
appliedRefCache
3391
3388
}
3392
3389
0 commit comments