| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|\
| |
| | |
Fix Tasty positions
|
| |
| |
| |
| |
| |
| |
| |
| | |
The plan is to keep original type until after pickling,
and afterwards replace it with a simple TypeTree.
# Conflicts:
# src/dotty/tools/dotc/core/tasty/TreePickler.scala
|
|/
|
|
|
| |
Even if outer class & method isn't polymorpnic,
inner method might be. Need to handle this correctly.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
See examples in following commit.
|
|
|
|
|
|
| |
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
|
|\
| |
| | |
Make Definitions survive recompilation of core definitions.
|
| | |
|
|/
|
|
| |
Fixed #912
|
|
|
|
|
| |
I scanned the main sources with IntellIJ's spell checker and
corrected what showed up.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Lazy fields are
- the rhs field of a ValDef or DefDef
- the body field of a Template
These can be instantiated with Lazy instances.
The scheme is such that lazy fields are completely
transparent for users of the Trees API.
The only downside is that the parameter used to initialize
a potentially lazy field has a weak type (now it's Any, with
Dotty it would be a union type of the form `T | Lazy[T]`.
Therefore, the parameter cannot be recovered through pattern
matching.
|
|
|
|
| |
See i321 doc for description of problem and decision taken.
|
|
|
|
|
|
| |
arguments.
Or it could lead to Ycheck error that was triggered in #321.
|
| |
|
|
|
|
| |
Typed MemberDef trees now take the modifiers from their symbol's data.
|
|
|
|
| |
It's not used anymore as superseded by previous commit.
|
|
|
|
|
|
| |
Now Try node always has cases as handlers.
In case handler is an Ident of type Throwable => T
than it's desugared to a CaseDef during parsing.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Unless a DefDef is a result of desugaring an exception handler it shouldn't be optimized by tailrec.
There's a potential improvement here: to detect that a DefDef
is a label def which itself is called only in tail position.
This is a requirement to implement #194
|
| |
|
|
|
|
|
| |
Avoids characterizing the "from" link in a return as a tail call
reference.
|
|
|
|
|
| |
Most transformations are subclasses of phase. Having a generic name
like `name` in scope everywhere is therefore very risky.
|
|
|
|
| |
Their functionality is now rolled into TypedTreeCopier.
|
|
|
|
|
|
|
|
| |
1) Add copiers with default arguments, to avoid boilerplate
2) All copiers are now curried wrt first argument (which is
the original tree).
We already make use of the new features in cpy.DefDef, but not yet elsewhere.
|
|
|
|
|
| |
Also renamed Boolean_and/or to _&&/||, to make it conform
to naming convention for other Definition operators.
|
|
|
|
|
|
|
|
| |
TreeTransforms are no longer phases. This allows to generate
new transforms in prepare... methods without running into the
problem that thee new transforms are undefined as phases.
It also makes for a cleaner separation of concerns.
|
|
|
|
|
|
|
|
|
| |
TailRec now relies on FullParameterization and uses two passes
for transformation. First one decides weather the method will
be transformed and if yes, starts rewriting calls in taill position.
Second one lifts the method body to a fully parameterized one,
correcting types.
|
|
|
|
|
|
|
| |
Added several forms of "select" and "appliedTo" methods which construct Select, Apply, TypeApply
trees.
Motivation: Infix methods allow chaining which is more legible than deep nesting.
|
| |
|
|
|
|
| |
Fixes to make the files in `transform` compile in Dotty.
|
|
|
|
|
|
| |
Conflicts:
src/dotty/tools/dotc/backend/jvm/BCodeBodyBuilder.scala
src/dotty/tools/dotc/core/Definitions.scala
|
|
Ported tailcall phase from scalac with such changes:
- all transformation is done in the phase itself
(previously half of the work was done in backend)
- it is now able to run before uncurry
- it is now a treeTransform
- renamed to tailrec to make it more obvious that
this phase transforms only recursive calls.
For now this is a single phase which speculatively
transforms DefDefs.
Speculation can be potentially removed by
splitting into 2 phases:
one detecting which methods should be transformed
second performing transformation.
But, as transformation requires as same amount of work
as detection, I believe it will be simpler to maintain
it as a single phase.
Conflicts:
tests/pos/typers.scala
|