| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|\
| |
| | |
Implement inline
|
| |
| |
| |
| |
| |
| |
| | |
`inline` is now a modifier keyword. To keep disruption tolerable,
we still allow `@inline` as an annotation as well. Other uses of
`inline` are supported only under `-language:Scala2` and are rewritten
to identifiers in backticks.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Drop @dotty.annotation.inline. This will inline all
@inline marked methods in Scala for which a body is known
(i.e. that are either compiled in the same run or have Tasty
trees available).
Option -Yno-inline suppresses inlining. This is needed for
the moment because some @inline methods access private members
or members that are otherwise inaccessible at the call-site.
Also fixes some problems in Inliner
- make sure type arguments to inline calls re fully defined
- don't forget recursive calls in typeMap
- don't forget positions in treeMap
- drop dead code dealing with outer.
|
| |
| |
| |
| |
| | |
To be done: outer accessors
To be done: error positions
|
|\ \
| |/
|/| |
[WIP] fix encoding issues
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
rename test/pos/valueclasses to pos_valueclasses
tests/pos/valueclasses generates a valueclasses.flags
file in /tests/partest-generated/pos that conflicts
with the valueClasses.flags file that
tests/neg/valueClasses.scala tries to create
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In particular:
- get rid of envelope, it's too complicated and hides too many errors
- check that everywhere in parsed trees the position range of a parent
node contains the position ranges of its children.
- check that all non-empty trees coming from parser have positions.
The commit contains lots of fixes to make these checks pass.
In particular, it changes the scheme how definitions are positioned.
Previously the position of a definition was the token range of the
name defined by it. That does obviously not work with the parent/children
invariant. Now, the position is the whole definition range, with the
point at the defined name (care is taken to not count backticks).
Namer is changed to still use the token range of defined name as the
position of the symbol.
|
|/
|
|
| |
And remove the not used Printer#echo
|
| |
|
|
|
|
| |
for html docs
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Roll `sm` and `i` into one interpolator (also called `i`)
Evolve `d` to `em` interpolator (for error messages)
New interpolator `ex` with more explanations, replaces disambiguation.
|
|
|
|
|
| |
Dotty uses ammonite.terminal since April (53bd25f) which replaces JLine.
There is no reason to keep it anymore.
|
|
|
|
|
| |
- increase page width
- print scopes more legibly under -verbose
|
|
|
|
|
|
| |
* -Xprint:[...] alone prints the trees without diffs.
* -Xprint-diff enables the diff on -Xprint.
* -Xprint-diff-del enables the diff with deletes on -Xprint.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The special case:
case stripped: TypeRef =>
stripped.symbol.is(BaseTypeArg)
is wrong because you might still want to reduce applications involving
TypeRefs which are not base class parameters, like in:
class Foo[A]
type Alias[X] = Foo[X]
val x: Alias[Int] = ???
`Alias` is a TypeRef so before this commit `Alias[Int]` was never reduced
to `Foo[Int]`. It should have been:
case stripped: TypeRef if stripped.symbol.is(BaseTypeArg) =>
true
But even this is incorrect: it assumes that we can always safely reduce HK
applications involving base class parameters, this is not the case when
the parameter kind is different from the rhs kind as illustrated by
`i1181c.scala`. We fix this by simply dropping the special case.
|
|\
| |
| | |
Improve Xprint
|
| |
| |
| |
| |
| |
| |
| | |
* Do not reprint a tree that has not changed.
* Highlight changes with yellow and insertions in green.
* -Xprint-diff-del: Inserts the deleted parts of the tree in red
and the parts that where changed in magenta.
|
|\ \
| |/
|/| |
Implement -Yno-predef and -Yno-imports
|
| |
| |
| |
| |
| |
| | |
* Implement flags -Yno-predef and -Yno-imports
* Add unit tests for both
|
| |
| |
| |
| |
| | |
Previous logic could only handle classes as constructors.
Also, address other reviewers comments.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Beta-reduce only if `Config.simplifyApplications` is true.
Turning off beta-reduction revealed two problems which are
also fixed in this commit:
1. Bad treatement of higher-kinded argyments in cyclicity checking
2. Wrong variance for higher-kinded arguments in TypeAccumulator
|
| |
| |
| |
| |
| | |
Allows us to drop also the involved knownHK method. Lots of other
cleanups.
|
| |
| |
| |
| |
| | |
Eliminate sameParams, add comments.
Also, minor cleanups elsewhere.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Remove the code that implemented the encoding of hk types
using refinements.
Drop the notion that RefinedTypes can be type parameters. This is
no longer true under the new representation.
Also, refactoring MemberBinding -> TypeParamInfo
|
| |
| |
| |
| |
| |
| |
| | |
The deleted assertion could fail for code that was
erroneous.
- Enable new hk scheme.
|
| |
| |
| |
| |
| | |
- Re-introduce newHK option. Label some things that will be
removed with OLD.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Simplify RefinedType
- Drop recursive definition of RefinedThis - this is now
taken over by RecType.
- Drop RefinedThis.
- Simplify typeParams
The logic avoiding forcing is no longer needed.
- Remove unused code and out of date comments.
|
| |
| |
| |
| | |
Optionally, check kinds of operands of & and | match.
|
| |
| |
| |
| |
| |
| |
| | |
For the moment under newHK flag.
- avoid crasher in derivedTypeParams (NamedTypes don't always have symbols)
- Revise logic in type comparer for new HK scheme
|
| | |
|
|/ |
|
|\
| |
| | |
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`) ?
|
|
|
|
|
|
|
|
|
|
| |
There's a trap otherwise that, when in a class inheriting
from Context (and with it Reporting) a call to println will
go to this.println and therefore might not print at all, if
the current context buffers messages. I lost a lot of time
on this on several occasions when I scratched my head why
a simple debug println would not show. Better avoid this in
the future for myself and others.
|
| |
|
|
|
|
| |
This commit also adds a printer for use by dottydoc.
|
|\
| |
| | |
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.
|