diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2016-11-17 17:57:13 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2016-11-21 22:12:07 +1000 |
commit | dde82ae61685698e66cb260ed1d66a0ba1b3c2da (patch) | |
tree | 6475a0ccc4fd5c8aa271c76bc0c6140f15d019dc /src/compiler/scala/tools/nsc/transform/AccessorSynthesis.scala | |
parent | 73678d4dafe250f0b38df2e953787af26b1a4ee3 (diff) | |
download | scala-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.scala | 2 |
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)) |