diff options
author | Paul Phillips <paulp@improving.org> | 2012-11-03 06:29:38 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-11-03 07:01:15 -0700 |
commit | 9c09c170998f74fba03990977b285e3121db32a6 (patch) | |
tree | ee12a85233e6927e5ec3698fc83f26fb46ad43e6 /src/reflect/scala/reflect/internal/Types.scala | |
parent | d3da3ef83293c0e174e07aba643b3a1f46c110c5 (diff) | |
download | scala-9c09c170998f74fba03990977b285e3121db32a6.tar.gz scala-9c09c170998f74fba03990977b285e3121db32a6.tar.bz2 scala-9c09c170998f74fba03990977b285e3121db32a6.zip |
Removing unused locals and making vars into vals.
According to "git diff" the difference from master to this
commit includes:
Minus: 112 vals, 135 vars
Plus: 165 vals, 2 vars
Assuming all the removed ones were vals, which is true from 10K feet,
it suggests I removed 80 unused vals and turned 133 vars into vals.
There are a few other -Xlint driven improvements bundled with this,
like putting double-parentheses around Some((x, y)) so it doesn't
trigger the "adapting argument list" warning.
Diffstat (limited to 'src/reflect/scala/reflect/internal/Types.scala')
-rw-r--r-- | src/reflect/scala/reflect/internal/Types.scala | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/reflect/scala/reflect/internal/Types.scala b/src/reflect/scala/reflect/internal/Types.scala index 0b065bb441..a5fc861b01 100644 --- a/src/reflect/scala/reflect/internal/Types.scala +++ b/src/reflect/scala/reflect/internal/Types.scala @@ -1725,8 +1725,8 @@ trait Types extends api.Types { self: SymbolTable => } protected def defineBaseClassesOfCompoundType(tpe: CompoundType) { - def define = defineBaseClassesOfCompoundType(tpe, force = false) - if (!breakCycles || isPastTyper) define + def define() = defineBaseClassesOfCompoundType(tpe, force = false) + if (!breakCycles || isPastTyper) define() else tpe match { // non-empty parents helpfully excludes all package classes case tpe @ ClassInfoType(_ :: _, _, clazz) if !clazz.isAnonOrRefinementClass => @@ -1735,11 +1735,11 @@ trait Types extends api.Types { self: SymbolTable => defineBaseClassesOfCompoundType(tpe, force = true) else { baseClassesCycleMonitor push clazz - try define + try define() finally baseClassesCycleMonitor pop clazz } case _ => - define + define() } } private def defineBaseClassesOfCompoundType(tpe: CompoundType, force: Boolean) { @@ -1999,7 +1999,7 @@ trait Types extends api.Types { self: SymbolTable => var change = false for ((from, targets) <- refs(NonExpansive).iterator) for (target <- targets) { - var thatInfo = classInfo(target) + val thatInfo = classInfo(target) if (thatInfo.state != Initialized) change = change | thatInfo.propagate() addRefs(NonExpansive, from, thatInfo.getRefs(NonExpansive, target)) @@ -2007,7 +2007,7 @@ trait Types extends api.Types { self: SymbolTable => } for ((from, targets) <- refs(Expansive).iterator) for (target <- targets) { - var thatInfo = classInfo(target) + val thatInfo = classInfo(target) if (thatInfo.state != Initialized) change = change | thatInfo.propagate() addRefs(Expansive, from, thatInfo.getRefs(NonExpansive, target)) @@ -4071,7 +4071,7 @@ trait Types extends api.Types { self: SymbolTable => variance = -variance val tparams1 = mapOver(tparams) variance = -variance - var result1 = this(result) + val result1 = this(result) if ((tparams1 eq tparams) && (result1 eq result)) tp else PolyType(tparams1, result1.substSym(tparams, tparams1)) case TypeBounds(lo, hi) => @@ -4133,7 +4133,7 @@ trait Types extends api.Types { self: SymbolTable => else copyMethodType(tp, params1, result1.substSym(params, params1)) case PolyType(tparams, result) => val tparams1 = mapOver(tparams) - var result1 = this(result) + val result1 = this(result) if ((tparams1 eq tparams) && (result1 eq result)) tp else PolyType(tparams1, result1.substSym(tparams, tparams1)) case NullaryMethodType(result) => @@ -4163,7 +4163,7 @@ trait Types extends api.Types { self: SymbolTable => copyRefinedType(rtp, parents1, decls1) case ExistentialType(tparams, result) => val tparams1 = mapOver(tparams) - var result1 = this(result) + val result1 = this(result) if ((tparams1 eq tparams) && (result1 eq result)) tp else newExistentialType(tparams1, result1.substSym(tparams, tparams1)) case OverloadedType(pre, alts) => |