| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
| |
Avoids characterizing the "from" link in a return as a tail call
reference.
|
| |
|
|
|
|
|
| |
Bring TermRefs in line with TypeRefs. Prefixes need to be kept so that termrefs
can be re-loaded in subsequent runs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Without this patch, ast.TreeInfo does not compile wfter next commit "Erasure should keep prefixes in
TermRefs". The reason is that outer path genertion generates a data race between
- an outer accessor created in ExplicitOuter
- a copy of the accessor created in ElimByName in a TreeTypeMap copy.
The patch avoids the data race by using a fixed symbol for the new TermRef generated in
outer.path during erasure.
But the fix seems ad-hoc. We should try to attack the problem at the root in TypeTreeMap.
The root problem seems to be that TypeTreeMap generates a copy of symbols whnMemere the copies
of the symbols give the same named type as the originals. We can either label the copied symbols
so that any types created from them become instances of WithNonMemberSym (which probably should be
renamed then). Or else we have a "linear" version of TreeMap that overrides sym denotations instead
of creating new symbols.
|
|
|
|
|
| |
If the original name in a selection is a inherited name, the erased name should
also be one.
|
| |
|
|
|
|
|
|
| |
If definitions in a class are substituted by TreeTypeMap, the new
symbols have to show up in the `decls` scope of the class instead of the
old ones.
|
|
|
|
|
| |
The reason is that otherwise the non-private member super.x gets merged with the private member this.x
and that causes a double binding violation.
|
|
|
|
|
| |
1) One phase too many was checked for postconditions.
2) Class members did not have their owners checked because index was not called on them.
|
|
|
|
|
| |
But allow pattern matching to provide outer accessors when needed
using with ensureOuterAccessors.
|
|
|
|
|
| |
foreachSubTree and existsSubTree are now infix methods. Streamlines their use
somewhat.
|
|
|
|
|
|
|
| |
Have a general way how a phase can establish a postcondition which will be
checked each time a later phase is tree-checked.
Moves erasure constraints from TreeChecker to Erasure's post condition.
|
|
|
|
|
|
| |
Now also testing that after erasure no outer this exists. Tests suit now includes
calls to local classes and methods which need an outer pointer, as well as passing
an outer pointer along a secondary constructor.
|
|
|
|
| |
Better to keep the old name for easy cross-referencing with Scala 2.
|
|
|
|
| |
... by reverting a premature optimization in Erasure.
|
|
|
|
|
|
|
| |
Catch exceptions and embed into string instead of passing exception on.
Reason: i"" strings are for diagnostic output but may cause exceptions such
as CyclicReferences, stale symbols and so on. We never want to crash the
program with such an exception.
|
|
|
|
| |
Have a configurable printer to which cyclic error messages are sent.
|
|
|
|
| |
Module roots were mis-characterized, which meant that module symbols were loaded twice.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Partial revert of 08c6eaca "this type is a term ref to the source module". The problem with
doing this is that it introduces spurious outer references. An inner module that contains
self referenves always needs the directly enclosing class. The revert avoids this dependency
by making ThisTypes always point to TypeRefs.
Several other changes were necessary to make the builds pass: TypeRefs had to get prefixes after
erasure so that they can be reloaded. Symbols of such typerefs had to be retrieved without forcing
a denotation.
One test (blockescapes.scala) fails and is moved to pending, awaiting further resolution.
Also two other new tests in pending which currently fail (and have failed before).
|
|
|
|
|
| |
Syntactically enclosing class is not accessible from such definitions,
so should be skipped.
|
|
|
|
|
| |
If there's a crash, we always want to see where the retyper was, not just for
tree checking.
|
|
|
|
|
| |
Needed to keep a record of definitions in supercall arguments. These
may not see the enclosing class.
|
|
|
|
|
|
|
| |
Outer paths, parameters and arguments are inserted in erasure, using methods provided
by OuterAccessors.
Also fixed a stupid bug in Erasure#constant
|
|
|
|
|
| |
Makes the method pioneered in elidablePrefix more general. Also applies
it to accessWithin.
|
|
|
|
|
|
|
| |
A this reference hide in a self ident, and be subsequently missed
when deciding on whether outer accessors are needed and computing outer paths.
We do this normalization directly after Typer, because during typer the
ident should rest available for hyperlinking.
|
|
|
|
| |
Also regorganized flags a bit to better use available slots.
|
|
|
|
|
| |
1) Constructors of inner classes get outer parameters
2) Outer arguments are passed as needed.
|
|
|
|
|
|
|
|
| |
The new phase replaces attachOuter. It creates outer accessors where needed
but does not yet define outer parameters or pass outer arguments.
It should run before pattern matcher, so that pattern matcher can access the
outer fields of scrutinees.
|
|
|
|
|
|
|
|
|
| |
Failing to do this leads to problems when retyping the This of
nested classes with the same name (e.g. nested anonymous classes as they appear in
t0453.scala).
RefinedPrinter was changed to avoid sugaring of anonymous classes when uniqid is
set (that was essential to track down the problem).
|
|
|
|
|
|
| |
The previous condition was too weak. The fix revealed a problem where
an "undefined symbol" error was thrown when reading an alias annotation
in the unpickler. The exception is now suppressed, the comment explains why.
|
|
|
|
| |
Non member symbols should not be reloaded in any case.
|
|
|
|
|
|
|
|
|
|
|
|
| |
// We treat two prefixes A.this, B.this as equivalent if
// A's selftype derives from B and B's selftype derives from A.
It makes sense to apply this principle to comparing this types in general, and not
only when being the prefix of a named type. Not doing so revealed a problem in
retyping Applications.scala after outerAccessors. There two type applications of
the same class had as prefixes (1) Applications.this, (2) Typer.this & Applications.this.
Typer and Applications match the principle, so the prefixes should be regarded as equivalent.
Why this manifested itself only after outerAccessors is an unsolved puzzle.
|
|
|
|
| |
The move caught an illegal erased type in a SelectFromType node.
|
|
|
|
|
| |
Defines a predicate isErasedTypes and checks that all tree types
and their widened underlying types are erased.
|
|
|
|
|
|
| |
Ident, Select, SelectFromTypeTrees denoting types should be eliminated
at some point. FirstTransform seems to be the logical place because
it already eliminates other forms of type trees.
|
|
|
|
|
|
|
| |
Otherwise the context captured by Definitions applies. And that one leads
to illegal types being constructed after erasure.
We should think how we can better avoid the trap of captured contexts here.
|
|
|
|
| |
And make its usage more systematic on all substitutions where it makes sense.
|
|
|
|
|
|
|
|
|
| |
This is done by predicating some shortcuts on tp.symbol.isStatic
where tp is a NamedType with the condition tp.denotationIsCurrent,
i.e. we avoid forcing the denotation. This safe because the branches
taken on isStatic are optimizations.
This commit contains the minimum set of changes to make showScala pass.
|
| |
|
|
|
|
|
|
|
|
| |
Main change: Introduce JavaArrayType as a new type constructor
for Java erased array. Translate all methods of Array class during
erasure to primitive operations on arrays.
Some other small fixes for more localized problems.
|
|
|
|
| |
On type error, show the source line where the failure occured.
|
| |
|
|
|
|
|
|
|
| |
The idea is that primitive operations do not have a symbol, but
when applied have directly a MethodType. Such operations will be
generated in Erasure for array ops. The patch allows retyping of
such operations.
|
|
|
|
|
| |
We would like to be able to define unencoded symbolic names in trees computed by the compiler.
The patch avoids their accidental encoding.
|
|
|
|
| |
Made implementation conform to doc comment.
|
|
|
|
|
| |
1) qualifier class was wrongly computed
2) Case where test or cast argument is primitive was not fully handled.
|
|
|
|
|
| |
This avoids stale symbol errors and does not need the somewhat
unsystematic symbol rebinding of the last commit.
|
|
|
|
|
|
|
|
|
|
|
| |
ThisTypes do escape. It seems that Scala 2 pickling produces ThisTypes that refer to base
classes of the class being compiled. If the base class is in a separate compilation unit,
this can lead to a stale class symbol in the ThisType. We solve this here by rebinding the
class symbol in the ThisType. We should also explore the alternative:
class ThisType(tref: TypeRef) ...
That would do the rebinding as part of the generation denotation resolution mechanism.
|
|
|
|
|
|
|
|
| |
Module classes now always get the sourceModule term ref as their this type.
We would like to eliminate ThisType() of a module class completely, as this
hangs on to a symbol which might become stale for globally accessible modules.
This commit is the first step. It contains the change to thisType and the necessary
fixes to make the test suite pass.
|
|
|
|
|
|
|
|
|
|
| |
Makes erasure pass the test suite.
Erasure is not yet turned turned on by default, because TestNonCyclic fails
with a stale symbol error. The problem is that This types are coupled to Symbols
and therefore don't reload. This is a problem is This types refer to static symbols
that get recompiled. We either have to drop using This types for static references,
or redefine thme so that can be reloaded.
|