| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Otherwise can create trees that do not pas Ycheck.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
It produced just the right hand side literal before.
|
|
|
|
| |
This affect initialisation order and we rely on artifacts of initialisation order in Dotty.
|
| |
|
| |
|
|
|
|
| |
For the moment, we keep all annotations on getters and setters, but this could be changed.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[@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.
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Now the default phase of treeTransformPhase is phase.next, we
can remove all overrides that specify the same phase.
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
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.
|