diff options
author | Hubert Plociniczak <hubert.plociniczak@epfl.ch> | 2011-10-04 07:51:07 +0000 |
---|---|---|
committer | Hubert Plociniczak <hubert.plociniczak@epfl.ch> | 2011-10-04 07:51:07 +0000 |
commit | e3bbd95afae33dbe4e8ac89167d019d831808618 (patch) | |
tree | 6fe42e12433a739ac2ed5f40440c6c5f58c194d3 /src/compiler/scala/tools/nsc/typechecker/Typers.scala | |
parent | 77d90e3aead2a48c1b5c633e57dea1b452b40db1 (diff) | |
download | scala-e3bbd95afae33dbe4e8ac89167d019d831808618.tar.gz scala-e3bbd95afae33dbe4e8ac89167d019d831808618.tar.bz2 scala-e3bbd95afae33dbe4e8ac89167d019d831808618.zip |
Partest now correctly parses -Yrangepos (previo...
Partest now correctly parses -Yrangepos (previously no effect). Fixed
some issues with range positions. partest now passes with -Yrangepos on.
review by odersky (mostly done already).
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index deff4c10a2..676ad34592 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -515,15 +515,15 @@ trait Typers extends Modes with Adaptations { // fails to notice exhaustiveness and to generate good code when // List extractors are mixed with :: patterns. See Test5 in lists.scala. def dealias(sym: Symbol) = - ({ val t = gen.mkAttributedRef(sym) ; t.setPos(tree.pos) ; t }, sym.owner.thisType) + (atPos(tree.pos) {gen.mkAttributedRef(sym)}, sym.owner.thisType) sym.name match { case nme.List => return dealias(ListModule) - case nme.Seq => return dealias(SeqModule) - case nme.Nil => return dealias(NilModule) + case nme.Seq => return dealias(SeqModule) + case nme.Nil => return dealias(NilModule) case _ => } } - val qual = typedQualifier { atPos(tree.pos.focusStart) { + val qual = typedQualifier { atPos(tree.pos.makeTransparent) { tree match { case Ident(_) => Ident(nme.PACKAGEkw) case Select(qual, _) => Select(qual, nme.PACKAGEkw) @@ -810,7 +810,7 @@ trait Typers extends Modes with Adaptations { tree setType tree.tpe } else tree match { // (6) case TypeTree() => tree - case _ => TypeTree(tree.tpe) setOriginal (tree) + case _ => TypeTree(tree.tpe) setOriginal (tree) setPos (tree.pos) } } @@ -1380,7 +1380,7 @@ trait Typers extends Modes with Adaptations { if (linkedClass == NoSymbol || !linkedClass.isSerializable || clazz.isSerializable) l else { clazz.makeSerializable() - l :+ TypeTree(SerializableClass.tpe) + l :+ (TypeTree(SerializableClass.tpe) setPos clazz.pos.focus) } val typedMods = removeAnnotations(mdef.mods) assert(clazz != NoSymbol) @@ -3733,7 +3733,7 @@ trait Typers extends Modes with Adaptations { // will execute during refchecks -- TODO: make private checkTypeRef in refchecks public and call that one? checkBounds(qual.pos, tp.prefix, sym.owner, sym.typeParams, tp.typeArgs, "") qual // you only get to see the wrapped tree after running this check :-p - }) setType qual.tpe, + }) setType qual.tpe setPos qual.pos, name) case accErr: Inferencer#AccessError => val qual1 = @@ -3979,13 +3979,13 @@ trait Typers extends Modes with Adaptations { val original = treeCopy.AppliedTypeTree(tree, tpt1, args1) val result = TypeTree(appliedType(tpt1.tpe, argtypes)) setOriginal original if(tpt1.tpe.isInstanceOf[PolyType]) // did the type application (performed by appliedType) involve an unchecked beta-reduction? - (TypeTreeWithDeferredRefCheck(){ () => + TypeTreeWithDeferredRefCheck(){ () => // wrap the tree and include the bounds check -- refchecks will perform this check (that the beta reduction was indeed allowed) and unwrap // we can't simply use original in refchecks because it does not contains types // (and the only typed trees we have have been mangled so they're not quite the original tree anymore) checkBounds(result.pos, tpt1.tpe.prefix, tpt1.symbol.owner, tpt1.symbol.typeParams, argtypes, "") result // you only get to see the wrapped tree after running this check :-p - }).setType(result.tpe) + } setType (result.tpe) setPos(result.pos) else result } else if (tparams.isEmpty) { errorTree(tree, tpt1.tpe+" does not take type parameters") |