summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
diff options
context:
space:
mode:
authorMiles Sabin <miles@milessabin.com>2009-07-23 03:11:28 +0000
committerMiles Sabin <miles@milessabin.com>2009-07-23 03:11:28 +0000
commit128c23c7880815a02667c2f720896d235ef6a7f8 (patch)
tree6e4091a67d7a918e0ba00458193378569d5a5d16 /src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
parent9dfe628e0fcdcaa6f53b44dac11284a782c3b97f (diff)
downloadscala-128c23c7880815a02667c2f720896d235ef6a7f8.tar.gz
scala-128c23c7880815a02667c2f720896d235ef6a7f8.tar.bz2
scala-128c23c7880815a02667c2f720896d235ef6a7f8.zip
Fixes for various invalid positions.
Diffstat (limited to 'src/compiler/scala/tools/nsc/ast/parser/Parsers.scala')
-rwxr-xr-xsrc/compiler/scala/tools/nsc/ast/parser/Parsers.scala14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
index 55aa4acf7d..d28f9424fe 100755
--- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
+++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
@@ -867,7 +867,8 @@ self =>
def wildcardType(start: Int) = {
val pname = freshName(o2p(start), "_$").toTypeName
val t = atPos(start) { Ident(pname) }
- val param = atPos(t2p(t)) { makeSyntheticTypeParam(pname, typeBounds()) }
+ val bounds = typeBounds()
+ val param = atPos(t.pos union bounds.pos) { makeSyntheticTypeParam(pname, bounds) }
placeholderTypes = param :: placeholderTypes
t
}
@@ -1822,10 +1823,13 @@ self =>
/** TypeBounds ::= [`>:' Type] [`<:' Type]
*/
- def typeBounds(): TypeBoundsTree =
- TypeBoundsTree(
+ def typeBounds(): TypeBoundsTree = {
+ val t = TypeBoundsTree(
bound(SUPERTYPE, nme.Nothing),
bound(SUBTYPE, nme.Any))
+ t setPos (t.hi.pos union t.lo.pos)
+ t
+ }
def bound(tok: Int, default: Name): Tree =
if (in.token == tok) { in.nextToken(); typ() }
@@ -2422,11 +2426,11 @@ self =>
if (in.token == ARROW) {
first match {
case Typed(tree @ This(name), tpt) if (name == nme.EMPTY.toTypeName) =>
- self = atPos(tree.pos) { makeSelfDef(nme.WILDCARD, tpt) }
+ self = atPos(tree.pos union tpt.pos) { makeSelfDef(nme.WILDCARD, tpt) }
case _ =>
convertToParam(first) match {
case tree @ ValDef(_, name, tpt, EmptyTree) if (name != nme.ERROR) =>
- self = atPos(tree.pos) { makeSelfDef(name, tpt) }
+ self = atPos(tree.pos union tpt.pos) { makeSelfDef(name, tpt) }
case _ =>
}
}