Skip to content
Browse files

Manual Backport of 3415436.

Fixed positions in de-aliased special symbols and for automatically added `apply` methods.

Fixed #5064, thanks to @paulp who showed the right direction (and how to test it).
  • Loading branch information...
1 parent 0054b6c commit 694037d12af5cd77acf39bdb3252c1df4b118536 @dragos dragos committed Sep 5, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/compiler/scala/tools/nsc/typechecker/Typers.scala
View
4 src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -497,7 +497,7 @@ trait Typers extends Modes {
// 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.makeTransparent) {gen.mkAttributedRef(sym)} setPos tree.pos, sym.owner.thisType)
sym.name match {
case nme.List => return dealias(ListModule)
case nme.Seq => return dealias(SeqModule)
@@ -871,7 +871,7 @@ trait Typers extends Modes {
case other =>
other
}
- typed(atPos(tree.pos)(Select(qual, nme.apply)), mode, pt)
+ typed(atPos(tree.pos)(Select(qual setPos tree.pos.makeTransparent, nme.apply)), mode, pt)
} else if (!context.undetparams.isEmpty && !inPolyMode(mode)) { // (9)
assert(!inHKMode(mode)) //@M
instantiate(tree, mode, pt)

0 comments on commit 694037d

Please sign in to comment.
Something went wrong with that request. Please try again.