summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/EtaExpansion.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2009-07-05 20:08:53 +0000
committerMartin Odersky <odersky@gmail.com>2009-07-05 20:08:53 +0000
commit64e41b43cc2f000ecbccb527d17425d9f0ce7f98 (patch)
treecd8e704b18cc40701f38e90d8ea7418454ec84a2 /src/compiler/scala/tools/nsc/typechecker/EtaExpansion.scala
parentc93f64f7ea35b53cdec95cad4891f7bd84604888 (diff)
downloadscala-64e41b43cc2f000ecbccb527d17425d9f0ce7f98.tar.gz
scala-64e41b43cc2f000ecbccb527d17425d9f0ce7f98.tar.bz2
scala-64e41b43cc2f000ecbccb527d17425d9f0ce7f98.zip
Fixed positions
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/EtaExpansion.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/EtaExpansion.scala16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/EtaExpansion.scala b/src/compiler/scala/tools/nsc/typechecker/EtaExpansion.scala
index deae3f114f..5f74567f2b 100644
--- a/src/compiler/scala/tools/nsc/typechecker/EtaExpansion.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/EtaExpansion.scala
@@ -76,9 +76,9 @@ trait EtaExpansion { self: Analyzer =>
else {
val vname: Name = freshName(tree.pos, 0)
defs += atPos(tree.pos)(ValDef(Modifiers(SYNTHETIC), vname, TypeTree(), tree))
- Ident(vname) setPos tree.pos
+ Ident(vname) setPos tree.pos.toSynthetic
}
- tree match {
+ val tree1 = tree match {
// a partial application using named arguments has the following form:
// { val qual$1 = qual
// val x$1 = arg1
@@ -98,6 +98,8 @@ trait EtaExpansion { self: Analyzer =>
case Ident(name) =>
tree
}
+ if (tree1 ne tree) tree1 setPos makeTransparent(tree1.pos)
+ tree1
}
/** Eta-expand lifted tree.
@@ -110,15 +112,11 @@ trait EtaExpansion { self: Analyzer =>
case mt: ImplicitMethodType =>
tree
case MethodType(paramSyms, restpe) =>
- var cnt0 = 0
- def cnt = {
- cnt0 += 1
- cnt0 - 1
- }
val params = paramSyms map (sym =>
ValDef(Modifiers(SYNTHETIC | PARAM), sym.name, TypeTree(sym.tpe), EmptyTree))
- atPos(tree.pos)(Function(params, expand(Apply(tree, params map gen.paramToArg), restpe)))
- //atPos(tree.pos)(Function(params, expand(Apply(tree, args), restpe)))
+ atPos(makeTransparent(tree.pos)) {
+ Function(params, expand(Apply(tree, params map gen.paramToArg), restpe))
+ }
case _ =>
tree
}