| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|\
| |
| | |
First of a series of compiler design documents
|
| | |
|
| |
| |
| |
| | |
Give a one-line explanation what each phase does in Compiler.
|
| |
| |
| |
| |
| | |
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.
|
|/
|
|
| |
builds
|
|
|
|
|
|
|
|
| |
This does not yet unable the checks that `@switch` verifies that
the compiler was indeed able to perform the optimization.
This implementation also does not support guards. A match with
guards will never be optimized as a switch.
|
| |
|
|
|
|
|
|
| |
This is a simpler fix than the previous one.
Local methods, cannot change `this` and do not need to go through
FullParameterization.
|
|
|
|
|
|
|
|
|
|
| |
If the method that recurses over a different type arguments,
if this method is specialised, it would lead to method not
being tail-rec anymore.
Eg:
def foo[@specialized A, @specialized B]: Unit = foo[B, A]
|
|
|
|
|
|
|
|
|
| |
TailRec methods remain members of enclosing class,
it means that they can refer to methods that require this.type.
It means that tailrec, unlike value classes is not allowed to widen
type of $this to it's full self type.
Fixes #1089
|
|\
| |
| | |
Repl fixes and tests
|
| |
| |
| |
| |
| |
| | |
Central config class replaces mixture of parameters and fields.
The fields were in part in the wrong class, where they could not
easily be overridden.
|
| |
| |
| |
| | |
It's used only in Resident, where it should be defined.
|
| |
| |
| |
| |
| | |
It messed up parsing of multi-line strings and did not
seem to have a purpose. Error messages print fine without it.
|
| |
| |
| |
| |
| | |
They printed as raw trees which confused the REPL
when wrapping subsequent liens with them.
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\ \
| | |
| | | |
Improvements & bugs that were discovered while implementing specialization.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
There were two sources of inefficiency in previous scheme:
- if symbol was no overriding anything the forwarder was still being
created
- the class that is will have the forwarder was not considered.
Many methods do not require forwarders as JVM will dispatch correctly.
|
| | |
| | |
| | |
| | |
| | | |
dropEmpty is not as clear, as it does not indicate what it drops.
Additionally makes phaseName by in sync with class name.
|
| | |
| | |
| | |
| | | |
Otherwise can create trees that do not pas Ycheck.
|
| | |
| | |
| | |
| | | |
Just like normal accessors.
|
|\ \ \
| | | |
| | | | |
dotc settings: String options after settings with colon shouldn't be ignored
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
whitespace
Format of some of the compiler settings was incompatible with scalac. For example "-target:jvm-1.8" is a valid argument for scalac, but it should be "-target: jvm-1.8" (with a whitespace) for dotc.
|
|\ \ \ \
| | | | |
| | | | | |
better positioning of `_*` not last argument error
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The error should be at the beginning of the underscore `_`,
not the next token after the star `*`, which is the default.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Rewriting did not go far enough, as evidenced by pos/i1174.scala
Fixes #1174
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The standard syntax in Dotty now is `xs : _*`. In Scala2 mode,
following code should be valid:
list match {
case List(_, _, _, _ @ _*) => 0
case List(_, _, _*) => 1
case List(_, _: _*) => 2
case Nil => 3
}
|
| |_|/
|/| |
| | |
| | |
| | |
| | | |
This allows to remove the ugly workaround for default methods.
There is also a slight adaptation for the new way to encode a
reference to the JS global scope in the IR.
|
|\ \ \
| | | |
| | | | |
Fix typing of SeqLiterals
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The field keeps track of the element type. This is necessary
because JavaSeqLiteral is nonvariant and the elements might
be empty, so we cannot always compute the type from the
element types.
|
| | | | |
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Add/collection strawman
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
It worked more or less by accident before. Now it's more complicated,
but we also have tests.
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | | |
Centered around views instead of iterators.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Implement most of the Scala.js IR code generator.
|
| | | | | | |
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Notable things that are not yet implemented:
* JS exports
* Scala.js-defined JS classes.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Notable things that are missing at this point:
* Pattern matching
* Try
* Most of the JavaScript interop
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Whether a language SAM type is also a valid SAM type for the
back-end is a platform-specific thing. On Scala.js, for example,
the rules are completely different than for the JVM.
This commit therefore moves the logic of the predicate used by
ExpandSAMs to decide whether to expand a SAM as an anonymous class
to the Platform.
|
|\ \ \ \ \ \
| |_|_|_|/ /
|/| | | | | |
First steps towards rewriting from Scala2 in dotty
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
1. trailing `_`:
`x _` is rewritten to `(() => x)` not to `x`
2. lazy vals:
Rewrites are done in Typer, not LazyVals. Later on we are too much at risk to
hit synthetically generated lazy vals.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
A constructor
def this() { ... }
needs to be rewritten to
def this() = { ... }
not to
def this(): Unit = { ... }
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
`Iterator.sliding(2, 1)` returns a one-element result if the original iterator
contains only one element, which makes it unpleasant to use for our task. Replaced
by a fold.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Gave overlapping positions in the case of longer lists of children.
|