| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
The problem was that TermRefWithSignatures did not take shadowed names into account
when reconstituting themselves under a new prefix.
|
|\
| |
| | |
Transform/extension methods
|
| |
| |
| |
| | |
Can now decide on rewiring on a node-by-nide basis.
|
| |
| |
| |
| | |
Adapt the transformation so that self types are handled correctly.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In a situation like
class C { this: D =>
}
the effective self type of the class is taken to be D & C.
Why? First, Scala 2.x does it that way. Second, it's needed to make the
FullParameterization transform go though.
|
| |
| |
| |
| | |
Problem was reported by @darkdimius. Test case will come in next commit.
|
| |
| |
| |
| |
| |
| |
| | |
t6574 has a new test where we produce identical code in an if-then-else. This broke
the rewiring logic before, and is fixed now.
Also, more comments and test cases.
|
| |
| |
| |
| |
| |
| | |
Methods dealing with fully parameterized versions of classes were
pulled from `TypeUtils` and `ExtensionMethods` into `FullyParameterization`.
`TypeUtils` is left for possible future use, but is empty right now.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This acommit allows TailRec to run after ExtensionMethods. This is
due to the following changes:
1) Extension methods now "rewire" calls to other extension methods of the
same class, so that they go directly to other extension methods
instead of to the original method in the class.
2) Tailrec annotations get removed from original method and get
added to the extension method instead.
With this commit all tests can be re-enabled again.
|
| |
| |
| |
| |
| |
| |
| |
| | |
1) Disabled insertApplyOrImplicit - it leads to untyped trees which cause
assertion errors down the road. In any case, neither apply methods nor
implicits can be inserted when retyping.
2) Avoid copying tree annotations into symbols when retyping.
|
| |
| |
| |
| |
| |
| | |
1) Avoid double transformation of a tree
2) Apply the type map to the type of the tree-mapped tree,
instead of to the type of the original tree.
|
| |
| |
| |
| |
| | |
Singleton types are normally widened before inferring types, yet
they did show up as elements of SeqLiterals.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When refined printing a DefTree, if one is after typer,
print the symbol's definition plus the rhs of the tree
rather than the contents of the tree.
Why: After typer, it's always the symbol's contents that should matter.
Question: Can we enforce through the types that parts of DefTree reflected
by the symbol disappear/are ignored?
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The previous version of ExtensionMethods added extension methods manually,
in the companion objetct scope, using enteredAfter. Extension methods therefore
had to run before pickling, so that other modules would see the generated extension methods.
This is suboptimal, for two reasons; (1) Mixin is very much like extension methods, yet it
has to run after pickling. (2) The pickling info gets larger than it has to be.
With this commit, extension methods are added as an InfoTransformer. So extension methods
now should run after pickling.
|
| |
| |
| |
| |
| |
| |
| | |
Pattern match needs to compare against list of names, not single name.
Universal equality bites again...
Also fix comment for ElimRepeated.
|
| |
| |
| |
| |
| | |
When figuring out which of a number of static methods corresponds to an overloaded dynamic
method, we only need to compare signatures. No need to resconstruct the full dynamic type.
|
| |
| |
| |
| | |
Removed diagnsostics message.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixed extension methods so that it now runs and passes the build.
Also enables ElimRepeated, which is a prerequistite for ExtensionMethods.
Exception: Tailrec is currently disabled, because it needs to run before
ExtensionMethods but it fails the -Ycheck test. Therefore the current tests
skip this phase.
|
| |
| |
| |
| |
| |
| |
| |
| | |
TreeTypeMap needs to track all binding occurrences and propagate maps
to all usage occurrences.
Also, fixed `ref` for prefixless types (these mapped to a SelectFromType tree before,
now are mapped to Idents).
|
| |
| |
| |
| |
| | |
Makes sure there are no references to RepeatedParamClass left in the types.
Also added placeholder for ElimLocals, which remains to be written.
|
| |
| |
| |
| | |
Some fixes to toStatic. Also added a method that transforms a RepeatedType to the corresponding Seq type.
|
| | |
|
| |
| |
| |
| | |
If -uniqid is on, RefinedPrinter now prints unique ids in definitions.
|
| |
| |
| |
| |
| |
| |
| |
| | |
If a symbol is defined in phases M..N, and that
symbol is then accessed in a phase before M, but in a new run,
we should not issue a stale symbol error (after all, the
symbol is not defined yet). Instead we now return a
NoDenotation.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The problem is that exploration methods are run and phase dependent,
whereas Definitions has an implicit context that freezes the period
when Definitions ewas created.
We should complement this by splitting Definitions into a global and
per/run part, but that is independent of the change in this commit.
|
| |
| |
| |
| |
| |
| |
| | |
1) Make local context go to module class if the tree symbol is a package val.
Perviously, this gave the wrong context owner for package definitions.
2) Add a hook to define the phase in which a transform should be run.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A membercache is not valid in a period different from the one it was
created in. Reason: The denotations stored in the cache might have
different infos in different periods.
Also: add maybeOwner convenience method for printing, which handles
NoDenotation/NoSymbol gracefully.
|
| |
| |
| |
| |
| |
| | |
Type params should have different flags, depending on whether they are
owned by a method or a class. Only class type parameters are marked Deferred,
protected, and Local.
|
| | |
|
| | |
|
| |
| |
| |
| | |
This is a trap waiting to happen elsewhere as well. Not clear how to avoid it.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Added two levels: pure and idempotent and fixed what look like
obvious bugs. It seems the previous treatment confused the two
levels.
Changed EtaExpansion and Erasure to use Pure instead of Idempotent
where appropriate.
|
| |
| |
| |
| |
| |
| | |
Added now because it affects purity if expressions: Inlined pure values
are pure even if referenced from impure prefixes (i.e. prefix need not
be evaluated).
|
| |
| |
| |
| | |
Convert expressions with constant types to Literals.
|
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
New phase for extension methods.
Also, split off some type handling functionality that can be used
elsewhere in new TypeUtils decorator. The idea is that TypeUtils should
contain methods on Type that make sense specifically for transformations.
That way, we can keep Types from growing. Might make sense to do similar
decorators for Denotations as well.
There's a bug fix in MacroTransform: Need to treat selfInfo varDels specially, since they have no symbol.
|
| |
| |
| |
| |
| |
| |
| | |
- 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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
1) We now always generate companion objects for classes. This is done in
mini-phase "companions", which also assures that companion-modules appear
after companion-classes.
2) PostTyperTransformers is gone; the part which normalizes trees has been
rolled into TreeTransform and the part which reordered companion classes
and modules is now in Companions.
Note: Some tests were deisabled; should be re-enabled by Dmitry where needed.
|
| |
| |
| |
| |
| | |
d.T is an access to a structural type member, so rejecting this is OK. Not sure why we compiled
this before without warning.
|
| |
| |
| |
| |
| |
| | |
The problem is that when an installAfter completely replaces a previous denotation, a symbol or NamedType
might still hang on to that denotation in the cache. We need to enforce that we switch to the new denotation.
This is done by setting the replaced denotation's validFor field to Nowhere.
|
| |
| |
| |
| |
| | |
... 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.
|
| |
| |
| |
| |
| |
| | |
(1) Make sure ModifierFlags is TermFlags and TypeFlags
(2) Shorten private <local> to private[this]; same with protected
(3) Print [this] for local symbols in RefinedPrinter
|
| | |
|
| |
| |
| |
| | |
Added this case, so that .symbol on a ThisType returns the underlying class.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Added the following utility methods:
- polyDefDef: Create a DefDef given a function that takes type and value parameters and yields a body.
- appliedToTypeTrees: Apply function to type arguments ion a TypeApply if arguments are nonempty.
- mkAsInstanceOf
- ensureConforms: generate a cast if expression has non-conforming type.
|
| | |
|
| |
| |
| |
| | |
Should do the same with other name-creator/name-test pairs.
|
|/
|
|
|
| |
This is done to streamline changing class denotations in new phases
by adding to (or otherwise modifying) their decls scope.
|
|\
| |
| | |
Fix using of wrong period for creating nested ctx in TreeTransforms
|