| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
- treated nested Matches correctly
- treat nested packages correctly
- SELECT always needs to select with sig
|
| |
|
|
|
|
| |
Both some long overdue pos tests and more pickleOK tests
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Selftypes can be nastily recursive as this example of extmethods shows:
class T[A, This <: That1[A]] extends AnyVal { self: This => ...
The problem, of course, is that This is really `this.This` and to determine
what that is we look up the self type which leads us right back to where we were.
We fix the problem by special casing references to class members in self-types.
These are always written symbolically, and compelmentary logic in unpickling
makes sure we do not need to compute the denotation of such members, but
instead take the denotation directly from the symbol.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
ElimLocals becomes a slightly less trivial transform: NormalizeFlags.
It also computes PureInterface flag, thus relieving Namer and Unpickler
from doing the same in two different ways. Besides, the computation in
Namer/TreeInfo was flawed because it did not take into account that
nested non-static classes are not allowed in an interface (only static
classes are, but these would not be members of the interface in the Scala
sense).
|
|
|
|
|
|
| |
- treat applied higher-kinded types specially when pickling (
drop #Apply projection)
- pickle the original self info sintead of the processed self type
|
|
|
|
|
|
|
| |
Use fewer length fields in type encodings.
- create new category of tags that take exactly one argument tree.
- avoid using length where a tag fits in one of theopther categories.
|
|
|
|
|
|
|
|
| |
Also: Make Pickler a plain phase; it is neither a macro transformer nor
a miniphase.
Add tests to pickleOK that are known to be stable under pickling/unpicking
by comparing tree representations via show.
|
| |
|
| |
|
|
|
|
| |
To avoid spurious differences and allow all flags in modifiers to be printed.
|
|
|
|
|
|
| |
Only roots should have their infos overwritten; other symbols in the
root scope should be replaced by same-named symbols in the Tasty file.
If we do not do this, we end up with inconsistent caches in root symbols.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Unpickler visits nodes in a certain order and (so far) expects to see
definitions before uses. This commit makes sure that the Unpickler generates
definitions in an order that matches the pickler's behavior. Every definition
should be "pre-registered" before it can be used. This still allows for mutual
recursion between symbols because preregistering enters all symbols of a scope
in bulk before generating any references to these symbols.
It would be nice if this was the end of the story, but unfortunately that's not the case.
It turned out that dotc produced references that were not legal according to the
implemented model, and that are also not legal in the formal type system. Each of these
violations referred to a symbol outside its scope. There were two sources:
1) Pattern-bound variables were retained in the type of a case block and, consequently,
the type of the enclosing match. This has been fixed by a previous commit a0f8ec21c9ce5381bea780e7be89286653fc676e.
2) Dependent anonymous functions led to (illegal) dependent closures with references
to their parameters leaking out in the environment. This has been mostly fixed by the previous commits,
in particular 1c70842036b083652c3eeab83aad0b2490674bfe. But there are still two problems remaining, see:
89c8bd8a1eb9fb3f0f09f25bedb68de1ef2e2ae8.
We might fix the two problems. But it's inconceivable to me that scalac could also
produce only "hygienic" trees that do not have escaping references. There are too many situations
where we know this is not true (existential skolems, for a start).
So we choose to flag escaping variables in logs instead of treating them as errors, and to deal with the
situation in the Unpickler.
|
|
|
|
|
|
|
|
| |
We have two unhygienic closures left - one in t1957.scala the other in Typer.scala.
This commit leaves some printlns that can be uncommented to get more info on these.
It would be better to fix them but I am running out of time to do so. Maybe someone
else can pick up with the info this commit allows to recover. To find out more,
go to t1957.scala and read the comment.
|
|
|
|
|
|
|
| |
We have two unhygienic closures left - one in t1957.scala the other in Typer.scala.
This commit leaves some printlns that can be uncommented to get more info on these.
It would be better to fix them but I am running out of time to do so. Maybe someone
else can pick up with the info this commit allows to recover.
|
|
|
|
|
| |
We now make sure that a closure's result type does avoid
references to parameter types.
|
|
|
|
|
|
|
| |
If a result type is not fully defined (i.e. has type variables),
dependency status depends on the instantiation of the variables.
In this case we now still ignore the variable but do not cache
the status for future uses.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous logic for avoiding dependent method types in closures had a hole.
The problem arose when the expected return type of a closure was a type variable.
Then, the that type variable would be taken as the declared result type of the
closure without (at first) checking the body. The type variable would not yet
be bounded and therefore would not represent a dependent method type. Afterwards
when typechecking the closure the type variable woul dbe bounded and instantiated.
But at that time, all checking and possibly avoiding of depenencies has already
happened.
We solve the problem by typing the body of a closure during Namer whenever the expected
type is not fully defined.
Doing so uncovered a problem that anonymus function were seen as the target of returns
(tehy shoul be skipped instead). Thsi problem is fixed by a patch to SymDenotations#isSourceMethod.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
According to the "new" interpretation of T#U as \exists x: T. x.U,
x.U is not a subtype of T#U. Hence variance in prefixes of named
types should be 0.
There is one case where this leads to problems. (Typing failure in
Desugar.scala, to be exact). This is when computing variances
in local type inference. We solve this problem locally
by overriding accumulator application to prefixes in the specific
variances accumulator. Because the "variances" accumulator is now
irregular wrt to the rest of variance handling, we move it
from Types to Inferencing, which is the only place where it is needed.
|
|
|
|
|
|
| |
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.
|
| |
|