| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Also, do some refactorings and fix some bugs in Inliner.
|
|
|
|
|
|
|
| |
1. Make genericType a trait instead of a class.
2. Make TypeLambda a type proxy
3. Split underlying in TypeProxy into underlying and superType
4. Cleanups in many other places
|
| |
|
|
|
|
|
|
|
|
|
| |
ParamForwarding converts some parameters to nullary methods, yet
it does not update the references to these parameters. Their signature
is still NotAMethod, which is wrong. Causes subtle differences in
peckle tests: a param accessor get type T before pickling (which is
wrong), gets => T when reading back (which is right). Test case in
pickling/selfSym.scala.
|
|
|
|
|
| |
There was a transcription error from scalac which caused the scope
of a `!` to be wrong.
|
|
|
|
|
|
|
|
| |
Scalac seems to treat superaccessors of traits in a rather peculiar way. They are
left unexpanded so that a class implementing several traits with the same superaccessors
will get duplicate methods with the same name. It seems this is then resolved in the backend.
Here we solve the issue by expanding the names of trait super accessors immediately.
|
| |
|
| |
|
|
|
|
|
| |
I have figured out how to make this the default in Eclipse, so hopefully
we won't see many repeats of this.
|
|
|
|
|
|
|
|
|
| |
New phase: PostTransform, runs after Typer.
SuperAccessors and ParamForwarders (renamed from ForwardParamAccessors) are
helper objects of post transform.
Next: Add instChecks as well.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previous scheme never went back once owner was taken to be invalid:
all enclosed code was assumed to be with invalid owners. This is not
true if the enclosed code contains a class or method.
Also previous scheme looked at the owner, whereas the only thing that
matters is the enclosing class. Therefore, by-name arguments are no longer
considered to be regions with invalid owners.
Also: run everything at thisTransform.next, except install forwarders
at thisTransform. Previous scheme was weird in that it switched to
thisTransform.next in an Apply node, but never switched back, even
if said Apply node contains nested classes that need forwarders.
|
|
|
|
|
|
|
|
|
|
|
| |
Not sure why we need to do this, and in any case it's not sure
what constitutes a pattern. There are certainly some parts of
patterns (e.g. prefixes of unapplies, or their implicit arguments)
that should be transformed under SuperAccessors, so the previous
condition was too coarse.
We include the test case that motivated the restriction. It looks like
it works now.
|
|
|
|
| |
Done in the interest of slimming down and modularizing SuperAccessors.
|
|
|
|
|
|
|
|
|
|
| |
The code got accidentally disabled when refactoring SuperAccessors for
pickling. The forwardParamAccessor method was applied only to non-parameters
where it is the identity (we really shopuld get test paramAccessors working,
then this would not have happened.
In the interest of better modularity, the code was placed in its own trait,
because it overlaps only marginally with the rest of SuperAccessors functionality.
|
|
|
|
| |
Used in at least two places, so it's of general use.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
1) DefDefs with implicit method types generate implicit parameters
2) Super accessors are inserted after class parameters.
With these changes files in core also print the same after pickling,
with the exception of Types and TypeOps which have some spurious differences:
Types are equal but appear in more simplified form after pickling.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Replaces `asInstanceOf[MutableScope]` calls.
|
|
|
|
|
|
|
|
|
| |
Checked by a new post condition after memoize.
Two bugs were detected and fixed by the condition
(1) Memoize did not implement getters and setters of ParamAccessors
(2) ResolveSuper did not implement super accessors in non-trait classes.
|
|
|
|
| |
Typed MemberDef trees now take the modifiers from their symbol's data.
|
|
|
|
| |
Need to have Method flag set
|
|
|
|
| |
Threw away list of constructed statements.
|
|
|
|
|
| |
This avoids stale symbol errors and does not need the somewhat
unsystematic symbol rebinding of the last commit.
|
|
|
|
|
| |
Most transformations are subclasses of phase. Having a generic name
like `name` in scope everywhere is therefore very risky.
|
|
|
|
|
|
|
|
| |
We now retype basically everything except leave nodes and definitions.
This provides for more robust tree copying and transformation. It also
flushed out errors in SuperAccessors (fixed by a hack, awaiting systematic
phase change there) and UnCurryTreeTransform. Uncurry is disabled for now,
will be fixed shortly.
|
|
|
|
|
|
| |
Those nodes that had so far a propagateType method defined
on them are automatically retyped on copying. No more
manual interventions are needed.
|
|
|
|
| |
Avoid mentioning arguments that are unchanged.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
asInstance/isInstance/ensureConforms/and/or.
They replace some former "mk..." methods.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Two improvements to TreeTransform:
1) Added transformOther functionality which handles trees not handled by other parts
2) Passes down Mode.Pattern in the context when in a pattern.
TreeTransform no longer normalizes unknown trees but passes them to transformOther.
The former Companions phase has been renamed to FirstTransform. It now performs the
following optimizations:
- adds companion objects (this was done before)
- other normalizations that were formally done in TreeTransform,
- rewrite native methods to stubs (this was formally done in RefChecks)
|
| |
|
|
|
|
|
| |
Added OverridingPairs
Small tweaks here and there.
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
- Some new functionality in tpd and in Symbols.
- Added `sm` interpolator to print nicely.
- Make use of nestedMap where possible.
- Add IdentityDenotTransformer as a convencience class
|
|
|
|
|
| |
... for the common supertype of MethodType, PolyType, and ExprType.
Signed was confusing.
|
|
Rewrote SuperAccessors (more to be done; see comments), and
added stuff here and there to make it work smoother.
|