| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
- represent directly as a list
- can replace separate inlineCount
|
|
|
|
|
| |
Error messages now print the inlined positions as well
as the position of the inlined call, recursively.
|
| |
|
|
|
|
| |
To do this, factor out Key from Attachment into a new type, Property.Key.
|
|
|
|
|
| |
To be done: outer accessors
To be done: error positions
|
|
|
|
| |
To access `DocBase`: `ctx.docbase.docstring(...)`
|
|
|
|
|
|
|
|
| |
Like dotty, dottydoc can now also enjoy the modularity of having
fused mini-phases. By extending `DocMiniPhase` and overriding the
appropriate methods, one can alter the DocAST easily.
ping: @DarkDimius
|
| |
|
| |
|
|\
| |
| | |
Fix stdout redirect for REPL's println
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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`) ?
|
|/
|
|
|
| |
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.
|
|\
| |
| | |
Fix Tasty errors
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
... of class parameters using the gadt mechanism. Previously they were encoded as aliases
by hardcoding alias bounds in the type parameter declaration, but that then leads to
weird behavior and failures in unpickling.
To make this work, we also need to propagate gadt bounds into the this-call context.
Test case in pickling/i1202a.scala.
|
|/
|
|
| |
This commit also adds a printer for use by dottydoc.
|
|
|
|
|
| |
Mode is used from a lot of low-level code, does not just reflect Typer info.
So it makes more sense top to place it in the core package.
|
|
|
|
|
|
|
|
| |
This broke under the recent introduction of the JS backend, because now
the context needs to be initialized before the platform can be selected.
So invoking `doti` immediately gave an IllegalStateException.
No big deal to fix, but it shows how sorely we are lacking REPL tests.
|
|
|
|
|
|
| |
This required the ability to instantiate a different `Platform`
depending on settings, which, in turn, required to defer the
initialization of `ContextBase.platform`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We introduce a new entry point for the compiler in
`dotty.tools.dotc.Driver`:
```
def process(args: Array[String], simple: interfaces.SimpleReporter,
callback: interfaces.CompilerCallback): interfaces.ReporterResult
```
Except for `args` which is just an array, the argument types and return
type of this method are Java interfaces defined in a new package called
`dotty-interfaces` which has a stable ABI. This means that you can
programmatically run a compiler with a custom reporter and callbacks
without having to recompile it against every version of dotty: you only
need to have `dotty-interfaces` present at compile-time and call the
`process` method using Java reflection.
See `test/test/InterfaceEntryPointTest.scala` for a concrete example.
This design is based on discussions with the IntelliJ IDEA Scala plugin
team. Thanks to Nikolay Tropin for the discussions and his PR
proposal (see #1011).
|
| |
|
|
|
|
|
| |
This makes the compiler extremely slow. To store the trace, you now need
to pass -Ytrace-context-creation
|
|
|
|
|
|
| |
Previously, we could set compilerCallback on non-fresh contexts, but
there is no reason that this should be allowed, and this is not done
anymore in the code since the last commit.
|
|
|
|
|
|
|
|
|
| |
- Document the entry points
- It is now possible to set a custom reporter without using a custom
context
- Use `null` for optional arguments to make it easier to run the
compiler using reflection or from Java.
- DPDirectCompiler does not use a custom context anymore
|
|
|
|
|
|
|
|
|
|
|
|
| |
With this commit and the previous one, partest should finally correctly
log the output of the compiler and display it at the end of its
execution if compilation failed.
Also make sure the initial Reporter in a Context is _not_ a ThrowingReporter.
Previously, the initial Reporter was always overriden in Compiler by
rootReporter so it had no effect, but this is not the case anymore, and
the negative junit tests fail with the ThrowingReporter since they throw
an exception instead of exiting with a certain number of errors.
|
| |
|
|
|
|
|
|
| |
Let asSeenFrom generate a marker annotated type
for any unsafe instantiation. Then cleanup in
typedSelect.
|
|
|
|
|
| |
This adds some simple callbacks to Dotty that should be enough to
get basic integration from IntelliJ.
|
|\
| |
| | |
Fix #877
|
| |
| |
| |
| | |
Needed to make builds deterministic.
|
|/
|
|
|
|
| |
ContextBase is not intended to be threadsafe, We now test that
indeed it is not shared by compileUnits calls operating on
different threads.
|
|
|
|
|
|
| |
withMode sets the whole mode, nit an individual bits. This was used
wrongly in several places. Make this less of a trap by renaming
withMode -> withModeBits.
|
|
|
|
| |
This reverts commit a43d39ad719978fbb36663f336c1c7cd2c4da1e0.
|
|
|
|
|
| |
Making a correct fix could take some time,
and I want to find other issues before I start working on this one.
|
|
|
|
|
|
|
| |
Add @sharable annotation for classes and vals that are presumed
to be safely sharable between threads.
Also: Document CtxLazy.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move addMode and friends to two decorators, one for Context, the other
for FreshContext. Implement behavior accordingly.
This avoids creating two contexts in situations like:
c.fresh.setxploreTyperState.addMode(...)
Mow we can write
c.fresh.addMode(...).setExploreTyperState
Because addMode returns a fresh context when applied to a fresh context.
Note that we specifically do not want virtual dispatch of addMode, that's
why it was moved to a decorator.
Also: removed mention of ".fresh: when just forllowed by an addMode, because
that one is redundant.
|
|
|
|
|
|
|
|
|
|
| |
LambdaLift needs to compute outer.path at the phase in which
the results are constructed, i.e. phase lambdaLift.next. Or else
we get an error in outer.path for lost fo files, including pos/Fileish.scala
as a minimized test case. Previously outer as computed at phase lambdaLift.
The reason for this is that lambdaLift name mangles inner classes, which
causes outer acessors to be not found. We now correct for the problem
in outer.path itself, by calling outerAccessor only at a safe phase.
|
|
|
|
|
| |
Typecomparer is not a good place because it gets re-generated for new context,
which causes the counts to be reset.
|
|
|
|
| |
It's a more logical home for them than the Context object.
|
|
|
|
|
| |
I scanned the main sources with IntellIJ's spell checker and
corrected what showed up.
|
| |
|
| |
|