| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Arguments to this(...) calls need a special contet,
similar to - but different from - the supercall context.
|
|
|
|
| |
Crashed before for untyped trees.
|
|
|
|
|
| |
So far, not needed, but is a reasonable precaution because the original
implementation of symbolOfType makes no sense for Retyper.
|
|
|
|
| |
Prompted by compiling more test files with erasure enabled.
|
|
|
|
|
| |
Print all flags if option -YDebugFlags is set.
Clean up printing of class type params.
|
|
|
|
|
|
| |
In TreeChecker, make sure that every identifier has a type with an elidable prefix.
This excludes identifiers pointing to members of random prefixes without making the
prefix explicit in the tree as part of a Select node.
|
|
|
|
|
| |
Make sure the package object appears in the prefix of a named type
where the symbol is owned by a package object.
|
|
|
|
|
|
|
|
| |
Super calls need to have special contexts, going beyond super-mode.
It's explained in detail in Context#superCallContext.
this(...) calls also need special contexts, but this is not enabled yet
(some tests fail, need to track down why).
|
|
|
|
|
| |
Reason: The tree traverser created by it only handles the cases for typed tree nodes.
Also add convenience existsSubTreeOf combinator.
|
|
|
|
|
|
| |
We should simply treat a typed tree in a splice as an untyped one here.
Note: the same trick does not work for TreeMap - an untyped treemap cannot
be extended to produce a typed tree.
|
|
|
|
|
|
|
|
| |
- Some types are different when erased (e.g. prefixes are NoPrefix)
- Some types are forbidden when erased. Put in assertions to check that fact.
Also, some renaming and doc comments to make creation of TermRefs and TypeRefs
clearer.
|
|
|
|
|
|
|
| |
The name duplications transform.Erasure / core.transform.Erasure
caused irregularities in the imports and the smae name was confusing.
Besides Erasure was the only class in core.transform, so it seemed
better to eliminate the package alltogether.
|
|
|
|
| |
... try to explain two tricky consequences of the denotation and signature model.
|
| |
|
|
|
|
|
| |
Refchecks now makes all members not-private that need it. This is done by
setting flag NotJavaPrivate. No name change is involved.
|
| |
|
|
|
|
| |
Don't want stringly types for this.
|
|
|
|
|
| |
Most transformations are subclasses of phase. Having a generic name
like `name` in scope everywhere is therefore very risky.
|
|
|
|
| |
Goes into a separate source files. Several simplifying refactorings.
|
|
|
|
|
|
|
|
|
| |
By-name parameters did not have their owner changed before.
This was not noticed in treecheck because the method generated
for the closure did not have its Method flag set by accident, so
owmer checking ignored the new val. Once the Methgod flag was set,
owner checking failed. Once changeOwner was added, a whole lot
of other things failed, which led to the fixes in the previous commits.
|
|
|
|
|
|
|
|
|
| |
(1) Template nodes have to be treated specially. They contain
primary constructors, self definitions and local dummys,
all of which have to be properly mapped and re-integrated.
(2) Symbol substitutions have ot be done all together instead of
one after the other.
(3) When creating new symbols, need to create ClassSymbols for ClassSymbols.
|
|
|
|
|
| |
Need to honor `from` if it exists, instead of searching for enclosing method.
Code motion might move the code under a different method.
|
|
|
|
| |
Now also checks owners of primary constructors and template local dummys.
|
|
|
|
|
|
| |
The previous version used `self` which referred to the `val` in
the implicit TypeOps value class (duh!). We really should make value
classes not require to have public fields.
|
|
|
|
| |
Local dummys in templates are not members of their enclosing classes.
|
|
|
|
| |
This is not yet needed but will probably come in handy later.
|
| |
|
|
|
|
|
|
| |
(1) Also handle This types - we need to be able to substitute the class symbol there.
(2) Keep NonMemberSym property when substituting
(3) In p.T, substitute in `p` even if `T` is replaced by substitution.
|
|
|
|
| |
if uniqid is set, print them with their unique ids.
|
|
|
|
|
| |
This should set the foundation to turn debug erasure so that it can be
turned on by default
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
New phase ElimByName elimintaes by-name parameters. All other
occurrences of parameterless methods and ExprTypes are eliminated
in erasure.
The reason for the split like this is that it is very hard for
Nullarify to determine when to insert ()'s. The logic for this
is fragile because we need to look at previous denotations which might
not exist (before splitter) or might result from a merge
between parameterless and nullary methods. In Erasure
the same is much simpler to achieve.
|
|
|
|
|
|
|
|
| |
well-typed code should not need further adapations. That's why `adapt` is
replaced by a subtype assertion in TreeChecker.
Flushed out two instances where typechecking did not produce well-adapted trees -
one in typedClosure, the other manifested itself in typedSuper.
|
|
|
|
|
|
|
| |
This required a change in Ycheck where we now only test that the new tree has a subtype of the old
one. Previously the requirement was "same type" but this caused "sigs.scala" to fail because
a new tree had a constant Int type where the old tree had just Int as the type. It's hard to guard
against these narrowings and they look harmless.
|
|
|
|
|
|
|
|
|
|
|
| |
Making cpy recompute types uncovered errors in uncurry. In a nutshell,
the intermediate Apply nodes of a curried function were ill-typed, which
caused errors produced by TypeAssigner. These nodes were eliminated down the
road, but the errors are already issued.
I did not find a good way to treat uncurry as a treetransform. Since it is rather
trivial, it did not seem warranted to make it a full transformer either. So in
the end the uncurry functionality became part of erasure.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Achieved by overridanle method treeTransformPhase in TreeTransform.
This is currently by default the current phase. We should migrate it
to the one after current phase.
|
|
|
|
| |
Their functionality is now rolled into TypedTreeCopier.
|
|
|
|
|
|
| |
Those nodes that had so far a propagateType method defined
on them are automatically retyped on copying. No more
manual interventions are needed.
|
| |
|
|
|
|
|
|
|
| |
elements.
It's not really an abbreviation to do it for trees with fewer elements and it leads
to unncessessary syntactic variation.
|
|
|
|
| |
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.
|
|
|
|
| |
RefChecks is now enabled. Some of the tests had to be fixed to be refchecks-correct.
|
|
|
|
| |
Should be `base`, was the class enclosing the definition.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Packages should always have a single denotation, which is invariant for all transformations.
Package members should always be entered in the first phase, and should never be entered
after a given phase.
This reflects the fact that package members correspond to classfiles. Once you create a classfile, it
stays around and is available from the start of the next run. Also, we need to prevent multiple
denotation versions of packages from hanging on to stale symbols. It would not be enough to replace
a package member by a newly compiled one; if packages had multiple denotations we'd have to do this
for all of them.
|
|
|
|
|
|
| |
Previously it did this only sometimes. Now it always prefers
concrete over deferred unless the deferred info is a proper subtype
of the concrete info.
|
|
|
|
|
| |
For overriding checks we need a concept where a val can match a def.
Normal matches does not provide this.
|
|
|
|
|
|
|
| |
(1) set position of companion object def
(2) companions of case classes taking multiple parameter lists do not inherit from
a function type (reason: we can't straightforwardly converyt a curried method
with multiple parameter lists to a function value).
|
| |
|