| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Hurray!
|
| |
|
| |
|
| |
|
|
|
|
| |
one.
|
| |
|
| |
|
|
|
|
|
| |
Was creating correct code, but was assuming that all objects with the same name share
same bits. No need to do it.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Erasure finishes work done by Explicit outer, and registers a post condition that This(outer) is not allowed.
|
| |
|
| |
|
|
|
|
| |
Also fixes problem with capturedVars, as no local vars are created.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
if symbol is defining starting from this phase
current.validFor.firstPhaseId < phase.id is always true.
If additionally f changes the initial symbol,
(current ne symbol.current) will always be true.
Else if a symbol has a single denotation that spawns all periods,
which is changed, second cycle becomes infinite.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
The intoConstr method is never called with argument inSuperCall = true.
So code dependent on it can be dropped.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With the previous commit, we get a bad owner for the "typedArgs" var
in `dotc.typer.Applications`. What happens is the following (@DarkDimius
figured it out):
Here's the code in question:
val result = {
var typedArg = ...
(code that captures typedArg)
}
There's an interplay between 3 mini-phases, which run in interleaved succession in the same
group:
Memoize
CapturedVars
Constructors
The following events happen in the order they are written:
1. typedArg is noted to be captured, so prepareValDef in CapturedVars
installs a new denotation, valid after CapturedVars, with a Ref type.
2. Memoize in transformDefDef creates a field for `result` and changes
the owner of all definitions in the right-hand side to the field,
using `changeOwnerAfter`. This gives `typedArg` a new denotation
with the owner being the field `result$local` and a validity period
from Memoize + 1 to CapturedVars + 1 (because CapturedVars has already
installed a new denotation).
3. Constructors runs intoConstructor which changes the owner again. All code
with the field as current owner becomes owned by the constructor. But
unfortunately `typedArg` is owned by the getter `result`, because that's
the denotation installed by the preceding phase, CapturedVars. So its
owner stays the `getter` even though its definition is now part of the
constructor. Boom, -Ycheck fails.
The fix applied here adds a new method `transformAfter` which can transform
all future denotations of a symbol. `changeOwnerAfter` uses this method to become
insensitive to the order in which denotations are installed.
Morale: State is hard.
|
|
|
|
|
| |
Bridges are never accessors, deferred, or lazy. Scalac removes these flags, I guess
this was dropped as an oversight. The change is needed to make the next commit work.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Without it, the previous commit make LazyVals blow up wgen compiling dotc/transform. I could not fugure out why, but here is the stacktrace I saw.
dotty.tools.dotc.core.Denotations$NotDefinedHere: demanding denotation of method $anonfun at phase seqLiterals(17) outside defined interval: defined periods are Period(22..22, run = 2)
at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:598)
at dotty.tools.dotc.core.Types$NamedType.computeDenot(Types.scala:1221)
at dotty.tools.dotc.core.Types$NamedType.denotAt(Types.scala:1206)
at dotty.tools.dotc.core.Types$NamedType.denot(Types.scala:1194)
at dotty.tools.dotc.ast.Trees$DenotingTree.denot(Trees.scala:270)
at dotty.tools.dotc.ast.Trees$Tree.symbol(Trees.scala:187)
at dotty.tools.dotc.ast.TypedTreeInfo$$anonfun$localSyms$1.apply(TreeInfo.scala:437)
at dotty.tools.dotc.ast.TypedTreeInfo$$anonfun$localSyms$1.apply(TreeInfo.scala:437)
at scala.collection.TraversableLike$WithFilter$$anonfun$map$2.apply(TraversableLike.scala:728)
at scala.collection.immutable.List.foreach(List.scala:381)
at scala.collection.TraversableLike$WithFilter.map(TraversableLike.scala:727)
at dotty.tools.dotc.ast.TypedTreeInfo$class.localSyms(TreeInfo.scala:437)
at dotty.tools.dotc.ast.tpd$.localSyms(tpd.scala:19)
at dotty.tools.dotc.ast.TreeTypeMap.transformDefs(TreeTypeMap.scala:116)
at dotty.tools.dotc.ast.TreeTypeMap.transform(TreeTypeMap.scala:98)
at dotty.tools.dotc.ast.Trees$Instance$TreeMap$$anonfun$transform$2.apply(Trees.scala:1181)
at dotty.tools.dotc.ast.Trees$Instance$TreeMap$$anonfun$transform$2.apply(Trees.scala:1181)
at scala.collection.immutable.List.loop$1(List.scala:172)
at scala.collection.immutable.List.mapConserve(List.scala:188)
at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1181)
at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1100)
at dotty.tools.dotc.ast.TreeTypeMap.transform(TreeTypeMap.scala:108)
at dotty.tools.dotc.ast.Trees$Instance$TreeMap$$anonfun$transform$2.apply(Trees.scala:1181)
at dotty.tools.dotc.ast.Trees$Instance$TreeMap$$anonfun$transform$2.apply(Trees.scala:1181)
at scala.collection.immutable.List.loop$1(List.scala:172)
at scala.collection.immutable.List.mapConserve(List.scala:188)
at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1181)
at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1100)
at dotty.tools.dotc.ast.TreeTypeMap.transform(TreeTypeMap.scala:108)
at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1100)
at dotty.tools.dotc.ast.TreeTypeMap.transform(TreeTypeMap.scala:108)
at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1094)
at dotty.tools.dotc.ast.TreeTypeMap.transform(TreeTypeMap.scala:108)
at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1100)
at dotty.tools.dotc.ast.TreeTypeMap.transform(TreeTypeMap.scala:108)
at dotty.tools.dotc.ast.TreeTypeMap.apply(TreeTypeMap.scala:129)
at dotty.tools.dotc.ast.tpd$TreeOps$.loop$1(tpd.scala:565)
at dotty.tools.dotc.ast.tpd$TreeOps$.changeOwner$extension(tpd.scala:568)
at dotty.tools.dotc.transform.LazyVals.transformLocalValDef(LazyVals.scala:110)
at dotty.tools.dotc.transform.LazyVals.transformValDef(LazyVals.scala:64)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[@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.
|
| |
|
|\
| |
| | |
Update comments on ParamForwarding and SuperAccessors.
|
| |
| |
| |
| |
| | |
This is useful for reproducing a problem. It tells us in particular in what order
fiels were compiled.
|
|/ |
|
|\
| |
| | |
Refactor/super accessors
|
| |
| |
| |
| |
| | |
I have figured out how to make this the default in Eclipse, so hopefully
we won't see many repeats of this.
|
| | |
|
| |
| |
| |
| | |
This means we now also pickle Imports and NamedArgs.
|
| |
| |
| |
| |
| |
| | |
Was missing before. Needed a tweak in PlainPrinter for printing
import symbol references (their denotation is not current after pickling, so
they would have printed differently after and before pickling).
|
| |
| |
| |
| |
| | |
Needed to harmonize behavior of Typer/Namer and tpd. This is needed
for making pickling, then unpickling the identity.
|
| |
| |
| |
| |
| | |
Everything that needs to be done before pickling moves to PostTyper.
The idea is that we want to make Pickler come before FirstTransform.
|
| |
| |
| |
| |
| | |
Frontend already drops all Java compilation units, so there's
nothing to do for FirstTransform.
|
| | |
|