summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@gmail.com>2016-12-07 15:39:51 +0100
committerLukas Rytz <lukas.rytz@gmail.com>2016-12-07 15:39:51 +0100
commit0f3f635d30551b1b96c64b955a85a3e535d1f2d2 (patch)
tree03b35095a9793774caa9f7c0910bdba76eb4a4e6 /src/compiler/scala/tools
parentee1c02b374a4b8a053e9a8b14af5e205afa67e14 (diff)
downloadscala-0f3f635d30551b1b96c64b955a85a3e535d1f2d2.tar.gz
scala-0f3f635d30551b1b96c64b955a85a3e535d1f2d2.tar.bz2
scala-0f3f635d30551b1b96c64b955a85a3e535d1f2d2.zip
SI-10072 cast Function nodes to environment in specialization
This commit basically make sure the fix for SI-5284 works correctly when a Function node reaches specialization (`-Ydealmbdafy:method` and IndyLambda are default in 2.12.x). To understand it, best read the excellent description in b29c01b. The code that's removed in this commit was added in 13ea590. It prevented `castType` from being invoked on the `Function` node, which is exactly what is needed here. It's also what happens under `-Ydelambdafy:inline`, the `new anonfun()` tree is being casted from `(Int, Int) => Int` to `(Int, A) => Int`.
Diffstat (limited to 'src/compiler/scala/tools')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Duplicators.scala4
1 files changed, 0 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala b/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala
index df014b5161..ea82739504 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala
@@ -240,10 +240,6 @@ abstract class Duplicators extends Analyzer {
result.symbol.updateAttachment(DelambdafyTarget)
result
- case fun: Function =>
- debuglog("Clearing the type and retyping Function: " + fun)
- super.typed(fun.clearType, mode, pt)
-
case vdef @ ValDef(mods, name, tpt, rhs) =>
// log("vdef fixing tpe: " + tree.tpe + " with sym: " + tree.tpe.typeSymbol + " and " + invalidSyms)
//if (mods.hasFlag(Flags.LAZY)) vdef.symbol.resetFlag(Flags.MUTABLE) // Martin to Iulian: lazy vars can now appear because they are no longer boxed; Please check that deleting this statement is OK.