summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/transform/AccessorSynthesis.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2016-11-17 17:57:13 +1000
committerJason Zaugg <jzaugg@gmail.com>2016-11-21 22:12:07 +1000
commitdde82ae61685698e66cb260ed1d66a0ba1b3c2da (patch)
tree6475a0ccc4fd5c8aa271c76bc0c6140f15d019dc /src/compiler/scala/tools/nsc/transform/AccessorSynthesis.scala
parent73678d4dafe250f0b38df2e953787af26b1a4ee3 (diff)
downloadscala-dde82ae61685698e66cb260ed1d66a0ba1b3c2da.tar.gz
scala-dde82ae61685698e66cb260ed1d66a0ba1b3c2da.tar.bz2
scala-dde82ae61685698e66cb260ed1d66a0ba1b3c2da.zip
Fix more compiler crashes with fields, refinement types
In the same manner as scala/scala-dev#219, the placement of the fields phase after uncurry is presenting some challenges in keeping our trees type correct. This commit whacks a few more moles by adding a casts in the body of synthetic methods. Fixes scala/scala-dev#268
Diffstat (limited to 'src/compiler/scala/tools/nsc/transform/AccessorSynthesis.scala')
-rw-r--r--src/compiler/scala/tools/nsc/transform/AccessorSynthesis.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/AccessorSynthesis.scala b/src/compiler/scala/tools/nsc/transform/AccessorSynthesis.scala
index a1923ead21..a0bba46398 100644
--- a/src/compiler/scala/tools/nsc/transform/AccessorSynthesis.scala
+++ b/src/compiler/scala/tools/nsc/transform/AccessorSynthesis.scala
@@ -332,7 +332,7 @@ trait AccessorSynthesis extends Transform with ast.TreeDSL {
val isUnit = isUnitGetter(lazyAccessor)
val selectVar = if (isUnit) UNIT else Select(thisRef, lazyVar)
- val storeRes = if (isUnit) rhsAtSlowDef else Assign(selectVar, rhsAtSlowDef)
+ val storeRes = if (isUnit) rhsAtSlowDef else Assign(selectVar, fields.castHack(rhsAtSlowDef, lazyVar.info))
def needsInit = mkTest(lazyAccessor)
val doInit = Block(List(storeRes), mkSetFlag(lazyAccessor))