summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Sabin <miles@milessabin.com>2009-07-23 19:26:01 +0000
committerMiles Sabin <miles@milessabin.com>2009-07-23 19:26:01 +0000
commit50b5242ee355b32266b7c061b696ecad8f84332f (patch)
tree846aa46fc054d3c1288b8449a79adc2e8d501116
parent437e8ef4bd3a82053eeaa3275e38c4d4028ab9ee (diff)
downloadscala-50b5242ee355b32266b7c061b696ecad8f84332f.tar.gz
scala-50b5242ee355b32266b7c061b696ecad8f84332f.tar.bz2
scala-50b5242ee355b32266b7c061b696ecad8f84332f.zip
Fixes for various invalid positions; ensure tha...
Fixes for various invalid positions; ensure that target class infos are suitably initialized.
-rwxr-xr-xsrc/compiler/scala/tools/nsc/ast/parser/Parsers.scala2
-rw-r--r--src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala8
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Types.scala2
3 files changed, 10 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
index a99fb1eb57..2c878a7841 100755
--- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
+++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
@@ -1827,7 +1827,7 @@ self =>
val t = TypeBoundsTree(
bound(SUPERTYPE, nme.Nothing),
bound(SUBTYPE, nme.Any))
- t setPos (t.hi.pos union t.lo.pos)
+ t setPos (wrappingPos(List(t.hi, t.lo)))
t
}
diff --git a/src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala b/src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala
index 78969e7e15..e3d5eab42d 100644
--- a/src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala
+++ b/src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala
@@ -76,7 +76,13 @@ abstract class TreeBuilder {
// with binds embedded in pattern tree1
val start = tree.pos.start
val end = start + name.decode.length
- buf += ((name, TypeTree(), r2p(start, start, end)))
+
+ // if the name range does overlap the bind we assume it is
+ // a fresh name (ie. generated from for(... ; (a, b) <- (1, 2) ...))
+ // make it transparent
+ val namePos0 = r2p(start, start, end)
+ val namePos = if (namePos0 overlaps tree.pos) makeTransparent(namePos0) else namePos0
+ buf += ((name, TypeTree(), namePos))
}
traverse(tree1)
case _ =>
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala
index 9c5367b29d..8547d49533 100644
--- a/src/compiler/scala/tools/nsc/symtab/Types.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Types.scala
@@ -1323,6 +1323,8 @@ trait Types {
for ((from, targets) <- refs(Expansive).iterator)
for (target <- targets) {
var thatInfo = classInfo(target)
+ if (thatInfo.state != Initialized)
+ change = change | thatInfo.propagate()
addRefs(Expansive, from, thatInfo.getRefs(NonExpansive, target))
}
change = change || refs(0) != lastRefs(0) || refs(1) != lastRefs(1)