aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/transform/Erasure.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-12-05 19:25:45 +0100
committerMartin Odersky <odersky@gmail.com>2014-12-05 19:26:24 +0100
commitfc23083675e4b194e42a0c310b1c43ab5d3aed2e (patch)
tree0d0895bebf4917a862dbb89ca2d662155acef9b9 /src/dotty/tools/dotc/transform/Erasure.scala
parent8336a0ddbe78b363394c48e3407b79c72008d2b3 (diff)
downloaddotty-fc23083675e4b194e42a0c310b1c43ab5d3aed2e.tar.gz
dotty-fc23083675e4b194e42a0c310b1c43ab5d3aed2e.tar.bz2
dotty-fc23083675e4b194e42a0c310b1c43ab5d3aed2e.zip
Fix by-name arguments
Previous scheme relying on Attachments was fragile. We now use a dummy method application, which transmits info reliably to Erasure.
Diffstat (limited to 'src/dotty/tools/dotc/transform/Erasure.scala')
-rw-r--r--src/dotty/tools/dotc/transform/Erasure.scala6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/transform/Erasure.scala b/src/dotty/tools/dotc/transform/Erasure.scala
index 5b70b2909..1cf0583dc 100644
--- a/src/dotty/tools/dotc/transform/Erasure.scala
+++ b/src/dotty/tools/dotc/transform/Erasure.scala
@@ -370,10 +370,8 @@ object Erasure extends TypeTestsCasts{
override def typedApply(tree: untpd.Apply, pt: Type)(implicit ctx: Context): Tree = {
val Apply(fun, args) = tree
- if (tree.removeAttachment(ElimByName.ByNameArg).isDefined) {
- val Select(qual, nme.apply) = fun
- typedUnadapted(qual, pt)
- }
+ if (fun.symbol == defn.dummyApply)
+ typedUnadapted(args.head, pt)
else typedExpr(fun, FunProto(args, pt, this)) match {
case fun1: Apply => // arguments passed in prototype were already passed
fun1