| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Fancy console reporter and the string interpolator for highlighting now
obey the color setting - this means that the next step towards unifying
the reporters is to make sure the tests work with
`FancyConsoleReporter` under the `-color:never` flag.
|
| |
|
|
|
|
|
| |
Previously we returned an empty Reporter with no errors so partest
reported the test as a success.
|
|
|
|
| |
It's used only in Resident, where it should be defined.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
| |
Previously, getMessage() always returned `null`, causing NPEs
when trying to report a FatalError.
|
|
|
|
|
| |
Makes side-effecting initialization of interpreter
unnecessary.
|
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also CompilerTest no longer runs the compiler with the context
DottyTest#ctx. Previously, we got away with this because
Compiler#process ignored it and created a new Context, but this commit
fixes this, and it is now very important that we use a different context
for every test we compile. Since DottyTest#ctx was the only part of
DottyTest we used, CompilerTest no longer extends DottyTest to make sure
that we do not use it accidentally. If we want to use DottyTest as a
base class for tests again, we will have to remove its implicit Context
field first.
Also do not try to initialize the definitions in the context used by
partest, this is not necessary.
|
|
|
|
|
| |
This adds some simple callbacks to Dotty that should be enough to
get basic integration from IntelliJ.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Used in rewritten `errorsReported` method. This fixes #866. The problem
before was that `TyperState#trywithFallBack` temporarily updates
the reporter, so crawling up the context chain to check for reporters
with errors missed some reported errors, which triggered the assertion
in `Tree#withType`.
|
|
|
|
| |
... making use of method in `ctx`.
|
|
|
|
|
|
| |
- Make parts more reusable
- Introduce hook "sourcesRequired" that controls whether
no sources on the command line give a help message.
|
| |
|
| |
|
|
|
|
|
|
| |
Previously, stackoverflows led to infinite loops because the catch
immediately threw another stack overflow. Anyway, one should never
catch Throwable.
|
| |
|
|
|
|
| |
And avoid name clashes
|
|
|
|
|
|
|
| |
Added general way to put attachments on some base type (which needs to inherit from Attachment.Container).
Used it to turn typedTree map into an attachment.
Also, moved DotClass to dotc.util.
|
|
|
|
|
| |
Otherwise we get spurious "compiled twice" errors on every symbol defined in a run after the first one.
Also, fixed a bug so that now run ids are correctly incremented.
|
|
|
|
|
|
|
|
| |
by command line options like
#compilers 3 #runs 10
This would create one after another 3 compiler instances and perform 10 runs in each.
|
| |
|
|
|
|
| |
Used wrong context/wrong reporter before.
|
|
|
|
| |
… more to come. Plus some bugfixes.
|
|
Left dummies for Compiler and Run.
|