| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| |
| | |
It turned out that avoid does not always produce a supertype of
the original type, which makes the additions in "ensureNoLocalRefs"
type incorrect. This commit fixes the problems.
|
| |
| |
| |
| |
| |
| |
| | |
... by applying the same "ensureNoLocalRefs" logic we already apply
to blocks. This change is necessitated by Pickling - escaping variables
are not defined before being referenced. The change uncovered in turn
problems in type avoidance.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
- when traversing a tree, we need to keep the context current so
that it always has the right owner. Otherwise recostructing lazy
trees will lead to failures in TypeAssigners.
- also, some tweaks concerning how parameters are displayed.
|
| |
| |
| |
| | |
Will get cross-talk ob cached symbols otherwise.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- better diagnostics, avoid try-finally-assert, because that masks errors.
- handle paths as terms correctly.
- need to set flags wholesale from pickling, not just add to them.
- fix pickling of refined types and skolem types.
- dealias type aliases representing parameter instantiations before pickling,
so that we do not refer to as-yet-undefined symbols.
|
| |
| |
| |
| |
| |
| |
| | |
The implicit def was shadowed by a following import. Scalac did not detect the problem probably because
the import and the def were in the same scope. But selecting the member explicitly would have caused an error
because the import came after the definition. So arguably this was in error, but scalac did not detect
it correctly.
|
| |
| |
| |
| |
| | |
Ambiguous implicits notifcations for selection views were propagataed to adapt but
then dropped.
|
| |
| |
| |
| |
| |
| | |
New version number: 0.04
Also removed dead code in pickler.
|
| |
| |
| |
| |
| |
| | |
1) Trait was missing, needs to be serialized.
2) The other two flags are not serialized, need to be reconstituted on
unpickling.
|
| |
| |
| |
| | |
The flag seems useful also for plain classes. No reason to restrict to traits.
|
| |
| |
| |
| |
| | |
1) Remove special treatment of PlainPrinter <module>.this.
2) Always use symbol mods when a symbol is available.
|
| |
| |
| |
| | |
New option -Ytest-pickler compares trees before and after pickling.
|
| | |
|
| | |
|
| |
| |
| |
| | |
Pickling still has to be written.
|
| |
| |
| |
| |
| | |
They do not have a generated apply method, so cannot be functions.
Problem was unvovered when changing the definition of LazyAnnotation.
|
| |
| |
| |
| |
| |
| |
| | |
When disambiguating overloaded alternatives in matchingSymbol we need
to apply asSeenFrom before comparing signatures. Before this was not done,
and led to a failure of determining the inherited result type of an
apply method in Checking, which in turn led to a type error.
|
| |
| |
| |
| | |
We got an ambiguous import error in PositionReader before.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Lazy trees can live longer than runs, so it is important
that they capture as little as possible. In particular they
should not capture contexts.
This change led with a ripple through effect to many changes
where operations now have to parameterzied with contexts, in
particular in what concerns tree folding.
The changes in turn uncovered some areas where dotc was
incompatible with scalac, and flagged correct things as errors.
These will be fixed in the next commits.
Another small twist: EmptyTrees will not be read in delayed mode,
so that one can check for lacking definitions without deserializing
the rhs.
|
| |
| |
| |
| | |
Used to print in raw form only.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The previous attempt was very fragile, and did not play
well with lazy trees, despite best intentions. It did
not work correctly for normal trees, and it seemed anyeway
very hard to extend this to annotations.
The new scheme, as outlined in PicklerFormat, is
simpler and naturally handles lazy trees and annotations.
|
| |
| |
| |
| | |
Single traverser, also handles lazy trees.
|
| |
| |
| |
| |
| |
| |
| | |
1) Treatment of root symbols simplified. TODO: check for double reads
2) Self defs no longer get symbols
3) class symbols now get their proper ClassInfos.
4) Some other smaller fixes
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
Static does not tell us whether to start the search it in empty package
or in root package.
|
| |
| |
| |
| | |
Refactored unpickling, splitting into several files.
|
| | |
|
| |
| |
| |
| | |
Will be used also for unpickling of positions.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
The idea is that we want to use the mapping from tree to Addr
in other sections, most immeditaely for positions, but it could
be others as well.
|
| |
| |
| |
| | |
Caused several small changes to Tasty format.
|
| |
| |
| |
| | |
Tasty files now always carry a random UUID.
|
| |
| |
| |
| |
| |
| | |
- will be needed for position deltas
- also simplify format in that negative constants
are no longer needed.
|
| |
| |
| |
| | |
Aim: re-use from Unpickler.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For Nat/AST trees, have the Nat come first.
The main advantage is when unpickling SELECT.
We need to know when unpickling the qualifier
whether we are in a constructor call (to set
inConstructor parameter of tpd.Super). We know
this only after having read the name in the
SELECT.
Also: tweaks to Pickler.
|
| |
| |
| |
| |
| |
| |
| | |
In particular: Allow for Addr(0) to point to
the middle of the `bytes` array. Needed so that
we can read trees without copying the bytes representing
trees into a fresh array.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem is that we need to be strict in the annotation symbol
(need to force at the latest when checking whether a definition
has some specific class of annotation), but should be lazy
in the rest of the tree.
This is achieved by pickling annotations with a symbol and a full
tree.
At the same time, Annotated trees can be ignored because they
are eliminated by Typer. We only need AnnotatedTypes.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Reason: It is really hard to establish when a context is a
inSuperCall context when unpickling trees. The unpickler does
not have the ability to look inside (untyped) trees, so it is
tricky/messy to detect a super.<init> or this.<init> Apply in a
constructor body.
Also: Always pickle template constructors.
|
| |
| |
| |
| | |
... so that this can be re-used in the tree unpickler.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| |
| |
| |
| | |
Bump version to 0.03. Harmonize doc comment and Google doc.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A tweak in the answer to a fundamental question of inference:
When should type variables be instantiated?
Example: In a call
f [ TVar ] ( g() )
A syntehsied type variable TVar can be instantiated as soon
as the call is fully elaborated, but not before - in particular not
when typing the nested call `g()`.
This is so far achieved by looking at the `owningTree` of a type variable
(in the example it would be the call above) and instantiating only if the
current tree contains the owning tree. Problem is that this is fragile.
If in the meantime the tree was copied, say due to eta-expansion, the contains
test will fail. Now this is not a big deal, as long as we instantiate the type
variable eventually. But previously that was never done.
With the fix we now instantiate type variables also if we have fully elaborated
the definition that closest encloses the point where the type variable is created.
This is less fragile, as definitions can be compared using their symbols instead
of looking at trees.
|
| |
| |
| |
| |
| | |
Need to always follow TypeVariables, otherwise we will
not detect orphan parameters of uninstantiated type variables.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The previous scheme generated too many newGenericArray expressions because
at the time newArray was called, the type arguments were not yet determined.
Furthermore, the type variables somehow did not have the right positions,
which caused them not to be interpolated and led to orphan PolyParams.
The new scheme converts the expression when the length parameter has been supplied
and it fully determines the array type before converting.
|