summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2008-07-22 11:30:53 +0000
committerMartin Odersky <odersky@gmail.com>2008-07-22 11:30:53 +0000
commit45cf39b3eed55dbb76fe298c533f8e26631660f3 (patch)
tree26b84d166ac2aa9ef14484851b6de6935d98db40
parent92da76f95732bca885a4f1704991d1a4363f3545 (diff)
downloadscala-45cf39b3eed55dbb76fe298c533f8e26631660f3.tar.gz
scala-45cf39b3eed55dbb76fe298c533f8e26631660f3.tar.bz2
scala-45cf39b3eed55dbb76fe298c533f8e26631660f3.zip
trying to fix build
-rwxr-xr-xsrc/compiler/scala/tools/nsc/symtab/BaseTypeSeqs.scala30
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Types.scala2
2 files changed, 25 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/BaseTypeSeqs.scala b/src/compiler/scala/tools/nsc/symtab/BaseTypeSeqs.scala
index 9947aa5209..e7d5a3daa2 100755
--- a/src/compiler/scala/tools/nsc/symtab/BaseTypeSeqs.scala
+++ b/src/compiler/scala/tools/nsc/symtab/BaseTypeSeqs.scala
@@ -32,7 +32,24 @@ trait BaseTypeSeqs {
def length: Int = elems.length
/** The type at i'th position in this sequence; lazy types are returned evaluated. */
- def apply(i: Int): Type = elems(i)
+ def apply(i: Int): Type = elems(i) /*
+match {
+ case RefinedType(variants, decls) =>
+ // can't assert decls.isEmpty; see t0764
+ //if (!decls.isEmpty) assert(false, "computing closure of "+this+":"+this.isInstanceOf[RefinedType]+"/"+closureCache(j))
+ //Console.println("compute closure of "+this+" => glb("+variants+")")
+ mergePrefixAndArgs(variants, -1, maxBaseTypeSeqDepth(variants) + LubGlbMargin) match {
+ case Some(tp0) =>
+ elems(i) = tp0
+ tp0
+ case None => throw new TypeError(
+ "the type intersection "+(parents mkString " with ")+" is malformed"+
+ "\n --- because ---"+
+ "\n no common type instance of base types "+(variants mkString ", and ")+" exists.")
+ }
+ case tp =>
+ tp
+ }*/
/** The type symbol of the type at i'th position in this sequence;
* no evaluation needed.
@@ -63,6 +80,7 @@ trait BaseTypeSeqs {
// (0 until length) exists (i => p(this(i)))
def normalize(parents: List[Type]) {
+/*
var j = 0
while (j < elems.length) {
elems(j) match {
@@ -81,6 +99,7 @@ trait BaseTypeSeqs {
}
j += 1
}
+*/
}
lazy val maxDepth: Int = {
@@ -101,7 +120,9 @@ trait BaseTypeSeqs {
def baseTypeSingletonSeq(tp: Type): BaseTypeSeq = new BaseTypeSeq(Array(tp))
/** Create the base type sequence of a compound type wuth given tp.parents */
- def compoundBaseTypeSeq(tsym: Symbol, parents: List[Type]): BaseTypeSeq = {
+ def compoundBaseTypeSeq(tp: CompoundType): BaseTypeSeq = {
+ val tsym = tp.typeSymbol
+ val parents = tp.parents
// Console.println("computing baseTypeSeq of " + tsym.tpe + " " + parents)//DEBUG
val buf = new ListBuffer[Type]
buf += tsym.tpe
@@ -149,9 +170,7 @@ trait BaseTypeSeqs {
val elems = new Array[Type](btsSize)
buf.copyToArray(elems, 0)
// Console.println("computed baseTypeSeq of " + tsym.tpe + " " + parents + ": "+elems.toString)//DEBUG
- new BaseTypeSeq(elems)
- }
-/*
+ tp.baseTypeSeqCache = new BaseTypeSeq(elems)
var j = 0
while (j < btsSize) {
elems(j) match {
@@ -172,5 +191,4 @@ trait BaseTypeSeqs {
}
tp.baseTypeSeqCache
}
-*/
}
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala
index 6584741fa1..0ddeb49996 100644
--- a/src/compiler/scala/tools/nsc/symtab/Types.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Types.scala
@@ -1035,7 +1035,7 @@ trait Types {
if (util.Statistics.enabled)
compoundBaseTypeSeqCount += 1
baseTypeSeqCache = undetBaseTypeSeq
- baseTypeSeqCache = memo(compoundBaseTypeSeq(typeSymbol, parents))(_.baseTypeSeq updateHead typeSymbol.tpe)
+ baseTypeSeqCache = memo(compoundBaseTypeSeq(this/*typeSymbol, parents*/))(_.baseTypeSeq updateHead typeSymbol.tpe)
// println("normalizing baseTypeSeq of "+typeSymbol+"/"+parents+": "+baseTypeSeqCache)//DEBUG
baseTypeSeqCache.normalize(parents)
// println("normalized baseTypeSeq of "+typeSymbol+"/"+parents+": "+baseTypeSeqCache)//DEBUG