aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/transform/Memoize.scala
Commit message (Collapse)AuthorAgeFilesLines
* Add postcondition check that ensures #971jvican2016-06-291-0/+21
|
* Memoize: perform required tree adaptation in setter.Dmitry Petrashko2016-03-151-2/+7
| | | | Otherwise can create trees that do not pas Ycheck.
* Mark concrete vals mixed in from Scala2 traits as mutable.Sébastien Doeraene2016-03-011-0/+1
| | | | | | | | | | | When a concrete val is mixed in from a Scala2 trait, a setter is generated, which is called by the `$init$` method. Since the assignment in this setter is not done in the constructor, it is nonsensical for the field to be immutable. This commit sets the Mutable flag on such fields. It only applies for vals coming from Scala2 traits. vals coming from Dotty traits are kept immutable.
* Memoize: bring back comment about how final vals are compiledDmitry Petrashko2015-09-141-0/+4
|
* Memoize should produce constant DefDefs for constant final vals.Martin Odersky2015-09-141-11/+10
| | | | It produced just the right hand side literal before.
* Memoize: duplicate scala2 behaviour: don't create fields for final vals.Dmitry Petrashko2015-09-141-2/+12
| | | | This affect initialisation order and we rely on artifacts of initialisation order in Dotty.
* Memoize: call transformFollowingDeep with correct owner.Dmitry Petrashko2015-08-241-7/+7
|
* Fix #745, memoise should be able to get type of field from setter.Dmitry Petrashko2015-07-281-8/+14
|
* Copy @field annotations from getters to fields.Martin Odersky2015-06-081-1/+10
| | | | For the moment, we keep all annotations on getters and setters, but this could be changed.
* Elim ElimWildcardIdentsMartin Odersky2015-06-011-2/+3
| | | | | | Instead of cleaning up, generate sensical code in the first place. This is shorter and (I would argue) clearer, and also has the advantage that some initializing assignments are not generated at all.
* Merge postConditions of memoize and constructorsMartin Odersky2015-06-011-6/+0
| | | | | | | If memoize and constructors are run in different groups, memoize's previous postcondition "all concerete methods are implemented" is wrong, because constructors are not implemengted yet. Solved by moving the postcondition to phase Constructors.
* Mixin: generate a getter in implementing class only if currentMartin Odersky2015-05-271-3/+3
| | | | | | A class might implement several fields in inherited traits with the same and type. In that case only one getter should be produced, but all initializing expressions have to be executed.
* Make Memoize not depend on prepareForDefDef.Dmitry Petrashko2015-04-301-23/+11
| | | | | | | | | | | | | [@darkdimius] I see no good reason for this, as it creates tight coupling between `ifs` in two methods. [@odersky] The reason is probably in the deleted comment: // allocate field early so that initializer has the right owner for subsequent phases in // the group. We now transform the rhs in subsequent phases with the getter as owner, where before it was the field. It is not clear to me whether this matters or not. [Update] We figured out the problem: It was a missing changeOwnerAfter in Constructor. Added to next commit.
* Make all Dotty source files end in newline.Dmitry Petrashko2015-04-091-1/+1
|
* Fixes to class field initializationMartin Odersky2015-03-111-1/+1
| | | | | | Class fields were not initialized from constructor parameters before. This is now fixed. The fix uncovered some problems with the treatement of outer parameters which are now also corrected.
* Remove fruitless overrides of treeTransformPhaseMartin Odersky2014-12-141-1/+0
| | | | | Now the default phase of treeTransformPhase is phase.next, we can remove all overrides that specify the same phase.
* Make sure all non-deferred methods are implementedMartin Odersky2014-12-031-2/+8
| | | | | | | | | Checked by a new post condition after memoize. Two bugs were detected and fixed by the condition (1) Memoize did not implement getters and setters of ParamAccessors (2) ResolveSuper did not implement super accessors in non-trait classes.
* Fixing memoize transforming java fields.Dmitry Petrashko2014-11-221-1/+1
|
* More docs and removing print statementsMartin Odersky2014-11-091-0/+6
|
* Merge memoize with miniphases following it into one group.Martin Odersky2014-11-091-14/+26
|
* New Mixin scheme.Martin Odersky2014-11-091-0/+68
Split into two phases, ResolveSuper before Erasure and Mixin after. Likewise GettersSetters is split into Getters and Memoize. All tests pass, except two tests fail when compiled twice. Will investigate next why.