| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To test this with sbt, see
https://github.com/lampepfl/dotty/wiki/Using-Dotty-with-sbt
The following flags are added:
- -Yforce-sbt-phases: Run the phases used by sbt for incremental compilation
(ExtractDependencies and ExtractAPI) even if the compiler is ran outside of
sbt, for debugging.
- -Ydump-sbt-inc: For every compiled foo.scala, output the API
representation and dependencies used for sbt incremental compilation
in foo.inc, implies -Yforce-sbt-phases.
This commit introduces two new phases which do not transform trees:
- `ExtractDependencies` which extracts the dependency information of the current
compilation unit and sends it to sbt via callbacks
- `ExtractAPI` which creates a representation of the API of the current compilation
unit and sends it to sbt via callbacks
Briefly, when a file changes sbt will recompile it, if its API has
changed (determined by what `ExtractAPI` sent) then sbt will determine
which reverse-dependencies (determined by what `ExtractDependencies`
sent) of the API have to be recompiled depending on what changed.
See http://www.scala-sbt.org/0.13/docs/Understanding-Recompilation.html for
more information on how sbt incremental compilation works.
This phase was originally based on
https://github.com/adriaanm/scala/tree/sbt-api-consolidate/src/compiler/scala/tools/sbt
which attempts to integrate the sbt phases into scalac (and is itself based
on https://github.com/sbt/sbt/tree/0.13/compile/interface/src/main/scala/xsbt),
but it has been heavily refactored and adapted to Dotty. The main
functional differences are:
- ExtractDependencies runs right after Frontend (so that we don't lose
dependency informations because of the simplifications done by PostTyper),
but ExtractAPI runs right after PostTyper (so that SuperAccessors are
part of the API).
- `ExtractAPI` only extract types as they are defined and never "as seen
from" some some specific prefix, see its documentation for more details.
- `ExtractDependenciesTraverser` and `ExtractUsedNames` have been fused into
one tree traversal in `ExtractDependenciesCollector`.
TODO: Try to run these phases in parallel with the rest of the compiler
pipeline since they're independent (except for the sbt callbacks in `GenBCode`) ?
|
| |
|
|
|
|
| |
This works similarly to `Trees#TreeTraverser`.
|
| |
|
| |
|
|
|
|
|
| |
SymDenotations#topLevelClass: don't throw an exception
Symbols#associateFile: avoid infinite loop
|
|\
| |
| | |
Fixes to lambdalift that prevent memory leaks.
|
| | |
|
| |
| |
| |
| | |
See t5375.scala for details.
|
| |
| |
| |
| |
| |
| |
| | |
Before there was an implicit assumption that static methods are only
present on objects.
This assumption is invalidated both by linker optimizations and the new
fix to lambdalift.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
CollectDependencies had incorrect handling of `Ident`s.
If it had ever met an `Ident` to a symbol defined outside of current
owner-chain(e.g. Predef.println) it would issue narrowTo(enclosingClass).
This is very conservative and leads to memory leaks
even in trivial lambdas.
My lambda-lift-foo groes stronger :-)
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
One drawback with this approach is that the type seems to propagate.
I.e. if the return type of an expression is `repeated` then the
enclosing variable will get the `repeated` type instead of getting the
expected `Seq` type
|
| | |
|
|\ \
| | |
| | | |
Fix bootstrap
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
As explained in the comment, a scalacLinkedClass must also
be a true companion unless the original symbol is a root. This
avoids us to drop the (potentially large) unpickled map and
save some memory.
|
| | |
| | |
| | |
| | |
| | |
| | | |
Otherwise we might get a false owner if completing from somewhere else.
We do not have a failing test to demonstrate the problem, but it looks
like the right thing to do.
|
| | |
| | |
| | |
| | |
| | | |
Include member defs inside templates in the enclosing class,
otherwise they would get localDummy as onwer.
|
| | |
| | |
| | |
| | |
| | | |
Instead of stubbing with potentially wrong owners and hping for the best, we
now compute owners on demand, using the lazy data structure of an OwnerTree.
|
| | |
| | |
| | |
| | |
| | |
| | | |
First step for a more robust scheme to access symbols in Tasty.
This entailed a swap of two fields in RefiendType, to make tree
format more uniform in what concerns where references are found.
|
| | |
| | |
| | |
| | |
| | |
| | | |
Compute initialization flags of possibly enclosing traits
elsewhere (in indexStats). Cleans up the logic and makes
the module more understandable.
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
It's possible that the given phase argument does not exist, in which case
we do not want to set the current phase to NoPhase.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Do this in the inferred (result-)type of ValDefs and DefDefs.
Without this fix, TreeTraverser#traverseChildren in Trees.scala
gets a result type of BoxedUnit (but only when co-compiled from
source, not when unpickled).
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We had a problem where unpickling an annotation containing a
class constant had the wrong type. Unpickling was done after erasure.
The type given to the constant was an alias but aliases got
eliminated during erasure, so the constant was malformed.
Unpickling annotation contents at the same phase as unpickling
the annotation carrier solves the problem.
It seems similar problems can arise when data is unpickled
using a LocalUnpickler. So we now make sure local unpickling
runs at the latest at phase Pickler.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Forcing it led to CyclicReferences involving RefChecks.OptLevelInfo when compiling
dotc/*.scala against Tasty files. The problem was that when transforming OptLevelInfo
the backend forced a transformInfo of RefChecks in TypeErasure which filtered RefCheck's
scope to eliminate non-class type definitions. Without the tweak in this commit this
tried to make all symbols current, and so came back to OptLevelInfo.
|
| | |
| | |
| | |
| | |
| | | |
Instrument Denotations#current to find CyclicReference errors
arising during transforms.
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
It caused an assertion error when separately compiling
parts of dotty against TASTY information. Not sure the
test achieves anything or whether it produces a false
negative.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When reading Tasty we need to pre-set the info of a class to some
ClassInfoType with (as yet) unknown parents and self type. But for
module classes, we need to know the source module at all time, and this
gets determined by the self type. So we now produce a TermRef
for the assumed self type of a module class.
|
|\ \ \
| | | |
| | | | |
Add bytecode checking infrastructure
|
| | | | |
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Annotated values are encapsulated in a `ConcreteAnnotation`, as such,
the statement `tpe isRef defn.IntClass` would yield false despite the
annotated reference being an Int.
The tpe is now unwrapped if it has an annotation. If the transformation
fails despite having the annotation the compiler will warn.
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The tests `i1059.scala` and `t3480.scala` are failing due to a bug
in pattern matcher that evaluates the `x` in `List(x: _*)` incorrectly.
Concerned issue: #1276
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
To make tests pass, this required a looser specification of
`assumedCanEquals`, so that an abstract type T can be compared to
arbitrary values, as long as its upper bound can be compared. E.g.
T == null
T == "abc"
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
Needed a fix in string interpolation for suriviving inserted
types that contain `$` characters.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Name, Symbol, Denotation, Type.
This uncovered two nonsensical comparisons, one in CollectEntryPoints,
the other in DottyBackendInterface.
|