@@ -85,25 +85,25 @@ trait Types
85
85
import definitions ._
86
86
import TypesStats ._
87
87
88
- /* TODO private*/ var explainSwitch = false
89
- /* TODO private*/ final val emptySymbolSet = immutable.Set .empty[Symbol ]
88
+ private var explainSwitch = false
89
+ private final val emptySymbolSet = immutable.Set .empty[Symbol ]
90
90
91
- /* TODO private */ final val LogPendingSubTypesThreshold = 50
92
- /* TODO private*/ final val LogPendingBaseTypesThreshold = 50
93
- /* TODO private*/ final val LogVolatileThreshold = 50
91
+ protected [internal] final val DefaultLogThreshhold = 50
92
+ private final val LogPendingBaseTypesThreshold = DefaultLogThreshhold
93
+ private final val LogVolatileThreshold = DefaultLogThreshhold
94
94
95
95
/** A don't care value for the depth parameter in lubs/glbs and related operations. */
96
- /* TODO private */ final val AnyDepth = - 3
96
+ protected [internal] final val AnyDepth = - 3
97
97
98
98
/** Decrement depth unless it is a don't care. */
99
- /* TODO private */ final def decr (depth : Int ) = if (depth == AnyDepth ) AnyDepth else depth - 1
99
+ protected [internal] final def decr (depth : Int ) = if (depth == AnyDepth ) AnyDepth else depth - 1
100
100
101
- /* TODO private*/ final val traceTypeVars = sys.props contains " scalac.debug.tvar"
102
- /* TODO private*/ final val breakCycles = settings.breakCycles.value
101
+ private final val traceTypeVars = sys.props contains " scalac.debug.tvar"
102
+ private final val breakCycles = settings.breakCycles.value
103
103
/** In case anyone wants to turn off type parameter bounds being used
104
104
* to seed type constraints.
105
105
*/
106
- /* TODO private*/ final val propagateParameterBoundsToTypeVars = sys.props contains " scalac.debug.prop-constraints"
106
+ private final val propagateParameterBoundsToTypeVars = sys.props contains " scalac.debug.prop-constraints"
107
107
108
108
protected val enableTypeVarExperimentals = settings.Xexperimental .value
109
109
@@ -247,7 +247,7 @@ trait Types
247
247
* type instead of the proxy. This gives buried existentials a
248
248
* chance to make peace with the other types. See SI-5330.
249
249
*/
250
- /* TODO private*/ def narrowForFindMember (tp : Type ): Type = {
250
+ private def narrowForFindMember (tp : Type ): Type = {
251
251
val w = tp.widen
252
252
// Only narrow on widened type when we have to -- narrow is expensive unless the target is a singleton type.
253
253
if ((tp ne w) && containsExistential(w)) w.narrow
@@ -1684,7 +1684,7 @@ trait Types
1684
1684
define()
1685
1685
}
1686
1686
}
1687
- /* TODO private*/ def defineBaseClassesOfCompoundType (tpe : CompoundType , force : Boolean ) {
1687
+ private def defineBaseClassesOfCompoundType (tpe : CompoundType , force : Boolean ) {
1688
1688
val period = tpe.baseClassesPeriod
1689
1689
if (period == currentPeriod) {
1690
1690
if (force && breakCycles) {
@@ -2006,8 +2006,8 @@ trait Types
2006
2006
* with synchronized, because they are accessed only from isVolatile, which is called only from
2007
2007
* Typer.
2008
2008
*/
2009
- /* TODO private*/ var volatileRecursions : Int = 0
2010
- /* TODO private*/ val pendingVolatiles = new mutable.HashSet [Symbol ]
2009
+ private var volatileRecursions : Int = 0
2010
+ private val pendingVolatiles = new mutable.HashSet [Symbol ]
2011
2011
2012
2012
class ArgsTypeRef (pre0 : Type , sym0 : Symbol , args0 : List [Type ]) extends TypeRef (pre0, sym0, args0) {
2013
2013
require(args0.nonEmpty, this )
@@ -3405,13 +3405,13 @@ trait Types
3405
3405
// Creators ---------------------------------------------------------------
3406
3406
3407
3407
/** Rebind symbol `sym` to an overriding member in type `pre`. */
3408
- /* TODO private*/ def rebind (pre : Type , sym : Symbol ): Symbol = {
3408
+ private def rebind (pre : Type , sym : Symbol ): Symbol = {
3409
3409
if (! sym.isOverridableMember || sym.owner == pre.typeSymbol) sym
3410
3410
else pre.nonPrivateMember(sym.name).suchThat(sym => sym.isType || sym.isStable) orElse sym
3411
3411
}
3412
3412
3413
3413
/** Convert a `super` prefix to a this-type if `sym` is abstract or final. */
3414
- /* TODO private*/ def removeSuper (tp : Type , sym : Symbol ): Type = tp match {
3414
+ private def removeSuper (tp : Type , sym : Symbol ): Type = tp match {
3415
3415
case SuperType (thistp, _) =>
3416
3416
if (sym.isEffectivelyFinal || sym.isDeferred) thistp
3417
3417
else tp
@@ -3660,9 +3660,9 @@ trait Types
3660
3660
3661
3661
// Hash consing --------------------------------------------------------------
3662
3662
3663
- /* TODO private*/ val initialUniquesCapacity = 4096
3664
- /* TODO private*/ var uniques : util.HashSet [Type ] = _
3665
- /* TODO private*/ var uniqueRunId = NoRunId
3663
+ private val initialUniquesCapacity = 4096
3664
+ private var uniques : util.HashSet [Type ] = _
3665
+ private var uniqueRunId = NoRunId
3666
3666
3667
3667
protected def unique [T <: Type ](tp : T ): T = {
3668
3668
if (Statistics .canEnable) Statistics .incCounter(rawTypeCount)
@@ -3704,7 +3704,7 @@ trait Types
3704
3704
def containsExistential (tpe : Type ) = tpe exists typeIsExistentiallyBound
3705
3705
def existentialsInType (tpe : Type ) = tpe withFilter typeIsExistentiallyBound map (_.typeSymbol)
3706
3706
3707
- /* TODO private*/ def isDummyOf (tpe : Type )(targ : Type ) = {
3707
+ private def isDummyOf (tpe : Type )(targ : Type ) = {
3708
3708
val sym = targ.typeSymbol
3709
3709
sym.isTypeParameter && sym.owner == tpe.typeSymbol
3710
3710
}
@@ -3803,16 +3803,16 @@ trait Types
3803
3803
* as a function over the maximum depth `td` of these types, and
3804
3804
* the maximum depth `bd` of all types in the base type sequences of these types.
3805
3805
*/
3806
- /* TODO private*/ def lubDepthAdjust (td : Int , bd : Int ): Int =
3806
+ private def lubDepthAdjust (td : Int , bd : Int ): Int =
3807
3807
if (settings.XfullLubs .value) bd
3808
3808
else if (bd <= 3 ) bd
3809
3809
else if (bd <= 5 ) td max (bd - 1 )
3810
3810
else if (bd <= 7 ) td max (bd - 2 )
3811
3811
else (td - 1 ) max (bd - 3 )
3812
3812
3813
- /* TODO private*/ def symTypeDepth (syms : List [Symbol ]): Int = typeDepth(syms map (_.info))
3814
- /* TODO private*/ def typeDepth (tps : List [Type ]): Int = maxDepth(tps)
3815
- /* TODO private*/ def baseTypeSeqDepth (tps : List [Type ]): Int = maxBaseTypeSeqDepth(tps)
3813
+ private def symTypeDepth (syms : List [Symbol ]): Int = typeDepth(syms map (_.info))
3814
+ private def typeDepth (tps : List [Type ]): Int = maxDepth(tps)
3815
+ private def baseTypeSeqDepth (tps : List [Type ]): Int = maxBaseTypeSeqDepth(tps)
3816
3816
3817
3817
/** Is intersection of given types populated? That is,
3818
3818
* for all types tp1, tp2 in intersection
@@ -3926,8 +3926,8 @@ trait Types
3926
3926
*/
3927
3927
final def hasLength (xs : List [_], len : Int ) = xs.lengthCompare(len) == 0
3928
3928
3929
- /* TODO private*/ var basetypeRecursions : Int = 0
3930
- /* TODO private*/ val pendingBaseTypes = new mutable.HashSet [Type ]
3929
+ private var basetypeRecursions : Int = 0
3930
+ private val pendingBaseTypes = new mutable.HashSet [Type ]
3931
3931
3932
3932
3933
3933
/** Does this type have a prefix that begins with a type variable,
@@ -3969,7 +3969,7 @@ trait Types
3969
3969
|| isValueElseNonValue(tp) // otherwise only value types
3970
3970
)
3971
3971
3972
- /* TODO private*/ def isHKTypeRef (tp : Type ) = tp match {
3972
+ private def isHKTypeRef (tp : Type ) = tp match {
3973
3973
case TypeRef (_, sym, Nil ) => tp.isHigherKinded
3974
3974
case _ => false
3975
3975
}
@@ -3985,7 +3985,7 @@ trait Types
3985
3985
*/
3986
3986
/** ** Not used right now, but kept around to document which Types
3987
3987
* land in which bucket.
3988
- /* TODO private*/ def isInternalTypeNotUsedAsTypeArg(tp: Type): Boolean = tp match {
3988
+ private def isInternalTypeNotUsedAsTypeArg(tp: Type): Boolean = tp match {
3989
3989
case AntiPolyType(pre, targs) => true
3990
3990
case ClassInfoType(parents, defs, clazz) => true
3991
3991
case ErasedValueType(tref) => true
@@ -3996,20 +3996,20 @@ trait Types
3996
3996
case _ => false
3997
3997
}
3998
3998
****/
3999
- /* TODO private*/ def isInternalTypeUsedAsTypeArg (tp : Type ): Boolean = tp match {
3999
+ private def isInternalTypeUsedAsTypeArg (tp : Type ): Boolean = tp match {
4000
4000
case WildcardType => true
4001
4001
case BoundedWildcardType (_) => true
4002
4002
case ErrorType => true
4003
4003
case _ : TypeVar => true
4004
4004
case _ => false
4005
4005
}
4006
- /* TODO private*/ def isAlwaysValueType (tp : Type ) = tp match {
4006
+ private def isAlwaysValueType (tp : Type ) = tp match {
4007
4007
case RefinedType (_, _) => true
4008
4008
case ExistentialType (_, _) => true
4009
4009
case ConstantType (_) => true
4010
4010
case _ => false
4011
4011
}
4012
- /* TODO private*/ def isAlwaysNonValueType (tp : Type ) = tp match {
4012
+ private def isAlwaysNonValueType (tp : Type ) = tp match {
4013
4013
case OverloadedType (_, _) => true
4014
4014
case NullaryMethodType (_) => true
4015
4015
case MethodType (_, _) => true
@@ -4020,7 +4020,7 @@ trait Types
4020
4020
* can be given: true == value type, false == non-value type. Otherwise,
4021
4021
* an exception is thrown.
4022
4022
*/
4023
- /* TODO private*/ def isValueElseNonValue (tp : Type ): Boolean = tp match {
4023
+ private def isValueElseNonValue (tp : Type ): Boolean = tp match {
4024
4024
case tp if isAlwaysValueType(tp) => true
4025
4025
case tp if isAlwaysNonValueType(tp) => false
4026
4026
case AnnotatedType (_, underlying, _) => isValueElseNonValue(underlying)
@@ -4070,7 +4070,7 @@ trait Types
4070
4070
corresponds3(tps1, tps2, tparams map (_.variance))(isSubArg)
4071
4071
}
4072
4072
4073
- /* TODO private */ def containsNull (sym : Symbol ): Boolean =
4073
+ protected [internal] def containsNull (sym : Symbol ): Boolean =
4074
4074
sym.isClass && sym != NothingClass &&
4075
4075
! (sym isNonBottomSubClass AnyValClass ) &&
4076
4076
! (sym isNonBottomSubClass NotNullClass )
@@ -4092,7 +4092,7 @@ trait Types
4092
4092
/** Does member `sym1` of `tp1` have a stronger type
4093
4093
* than member `sym2` of `tp2`?
4094
4094
*/
4095
- /* TODO private */ def specializesSym (tp1 : Type , sym1 : Symbol , tp2 : Type , sym2 : Symbol , depth : Int ): Boolean = {
4095
+ protected [internal] def specializesSym (tp1 : Type , sym1 : Symbol , tp2 : Type , sym2 : Symbol , depth : Int ): Boolean = {
4096
4096
require((sym1 ne NoSymbol ) && (sym2 ne NoSymbol ), ((tp1, sym1, tp2, sym2, depth)))
4097
4097
val info1 = tp1.memberInfo(sym1)
4098
4098
val info2 = tp2.memberInfo(sym2).substThis(tp2.typeSymbol, tp1)
@@ -4226,7 +4226,7 @@ trait Types
4226
4226
*/
4227
4227
4228
4228
/** Are `syms1` and `syms2` parameter lists with pairwise equivalent types? */
4229
- /* TODO private */ def matchingParams (syms1 : List [Symbol ], syms2 : List [Symbol ], syms1isJava : Boolean , syms2isJava : Boolean ): Boolean = syms1 match {
4229
+ protected [internal] def matchingParams (syms1 : List [Symbol ], syms2 : List [Symbol ], syms1isJava : Boolean , syms2isJava : Boolean ): Boolean = syms1 match {
4230
4230
case Nil =>
4231
4231
syms2.isEmpty
4232
4232
case sym1 :: rest1 =>
@@ -4432,7 +4432,7 @@ trait Types
4432
4432
}
4433
4433
4434
4434
/** The current indentation string for traces */
4435
- /* TODO private */ var indent : String = " "
4435
+ protected [internal] var indent : String = " "
4436
4436
4437
4437
/** Perform operation `p` on arguments `tp1`, `arg2` and print trace of computation. */
4438
4438
protected def explain [T ](op : String , p : (Type , T ) => Boolean , tp1 : Type , arg2 : T ): Boolean = {
0 commit comments