diff options
author | Martin Odersky <odersky@gmail.com> | 2007-11-21 17:08:30 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2007-11-21 17:08:30 +0000 |
commit | 062fedaefab69490c17df22114088b47ca46bad8 (patch) | |
tree | e7d4d8b81b3baac4159b8e9c2431412fd7f2f292 /src | |
parent | 96792348fa71f5df08a8ca26db001f76f15d73b1 (diff) | |
download | scala-062fedaefab69490c17df22114088b47ca46bad8.tar.gz scala-062fedaefab69490c17df22114088b47ca46bad8.tar.bz2 scala-062fedaefab69490c17df22114088b47ca46bad8.zip |
fixed #246. adapted check files.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Types.scala | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala index 112f419bcd..87dd555db4 100644 --- a/src/compiler/scala/tools/nsc/symtab/Types.scala +++ b/src/compiler/scala/tools/nsc/symtab/Types.scala @@ -2260,9 +2260,16 @@ A type's typeSymbol should never be inspected directly. /** Map this function over given list of symbols */ def mapOver(origSyms: List[Symbol]): List[Symbol] = { - val origInfos = origSyms map (_.info) - val newInfos = List.mapConserve(origInfos)(this) - if (newInfos eq origInfos) origSyms // fast path in case nothing changes due to map + var change = false + val newInfos = for (sym <- origSyms) yield { + val v = variance + if (sym.isAliasType) variance = 0 + val result = this(sym.info) + if (result ne sym.info) change = true + variance = v + result + } + if (!change) origSyms // fast path in case nothing changes due to map else { // map is not the identity --> do cloning properly val clonedSyms = origSyms map (_.cloneSymbol) val clonedInfos = clonedSyms map (_.info.substSym(origSyms, clonedSyms)) |