diff options
author | Martin Odersky <odersky@gmail.com> | 2010-04-26 10:15:37 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2010-04-26 10:15:37 +0000 |
commit | 796d24e1027119af2f2e917cdc66c06da9b3ec6b (patch) | |
tree | 706b60be0db0fe1d049bffc820876cf26b462e0d /src/compiler | |
parent | 9af947ea3a2c606efac01b1fcb5e88e0aeaadc08 (diff) | |
download | scala-796d24e1027119af2f2e917cdc66c06da9b3ec6b.tar.gz scala-796d24e1027119af2f2e917cdc66c06da9b3ec6b.tar.bz2 scala-796d24e1027119af2f2e917cdc66c06da9b3ec6b.zip |
Solves the "same type after erasure problem" un...
Solves the "same type after erasure problem" uncovered by Derek. Review
by rytz.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Types.scala | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala index 863ad7bec4..8f1ece5b9e 100644 --- a/src/compiler/scala/tools/nsc/symtab/Types.scala +++ b/src/compiler/scala/tools/nsc/symtab/Types.scala @@ -1205,7 +1205,18 @@ trait Types extends reflect.generic.Types { self: SymbolTable => } else { incCounter(compoundBaseTypeSeqCount) baseTypeSeqCache = undetBaseTypeSeq - baseTypeSeqCache = memo(compoundBaseTypeSeq(this))(_.baseTypeSeq updateHead typeSymbol.tpe) + baseTypeSeqCache = if (typeSymbol.isRefinementClass) + memo(compoundBaseTypeSeq(this))(_.baseTypeSeq updateHead typeSymbol.tpe) + else + compoundBaseTypeSeq(this) + // [Martin] suppressing memo-ization solves the problem with "same type after erasure" errors + // when compiling with + // scalac scala.collection.IterableViewLike.scala scala.collection.IterableLike.scala + // I have not yet figured out precisely why this is the case. + // My current assumption is that taking memos forces baseTypeSeqs to be computed + // at stale types (i.e. the underlying typeSymbol has already another type). + // I do not yet see precisely why this would cause a problem, but it looks + // fishy in any case. } } //Console.println("baseTypeSeq(" + typeSymbol + ") = " + baseTypeSeqCache.toList);//DEBUG |