aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* More fixes to unpicklingMartin Odersky2015-03-183-22/+25
| | | | | | - treated nested Matches correctly - treat nested packages correctly - SELECT always needs to select with sig
* Tweak to printing TypevarsMartin Odersky2015-03-181-1/+2
|
* More testsMartin Odersky2015-03-188-0/+217
| | | | Both some long overdue pos tests and more pickleOK tests
* Fix tricky problem with re-establishing denotations of selftypesMartin Odersky2015-03-182-8/+31
| | | | | | | | | | | | | 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.
* Fix TastyReader#readLongIntMartin Odersky2015-03-182-1/+34
|
* Compute PureInterface flag after pickling.Martin Odersky2015-03-1814-52/+445
| | | | | | | | | | 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).
* More fixes to picklingMartin Odersky2015-03-183-8/+19
| | | | | | - treat applied higher-kinded types specially when pickling ( drop #Apply projection) - pickle the original self info sintead of the processed self type
* Changes to Tasty formatMartin Odersky2015-03-185-80/+74
| | | | | | | 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.
* Allow several units to be pickle-tested at once.Martin Odersky2015-03-187-19/+187
| | | | | | | | 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.
* Various fixes to PickleFormat, pickler and unpicklerMartin Odersky2015-03-183-66/+143
|
* Avoid annotations being dropped by stripTypeVarMartin Odersky2015-03-181-1/+2
|
* Tweaks to printingMartin Odersky2015-03-183-5/+14
| | | | To avoid spurious differences and allow all flags in modifiers to be printed.
* Change handling of roots when unpicklingMartin Odersky2015-03-182-4/+6
| | | | | | 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.
* Keeping track of unpickling definition order in Pickler.Martin Odersky2015-03-184-25/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Better tracking of unhygienic closure typesMartin Odersky2015-03-181-2/+27
| | | | | | | | 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.
* Better tracking of unhygienic closure typesMartin Odersky2015-03-181-2/+5
| | | | | | | 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.
* Avoid dependent methods being closures.Martin Odersky2015-03-183-11/+34
| | | | | We now make sure that a closure's result type does avoid references to parameter types.
* More careful determination of MethodType#isDependentMartin Odersky2015-03-181-9/+18
| | | | | | | 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.
* Avoiding dependent method types in closuresMartin Odersky2015-03-182-8/+16
| | | | | | | | | | | | | | | | | 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.
* Fix variance of type prefixes in TypeMap and TypeAccumulatorMartin Odersky2015-03-182-30/+55
| | | | | | | | | | | | | | 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.
* Fix problems in avoidMartin Odersky2015-03-181-2/+6
| | | | | | 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.
* Avoid escaping pattern bound variablesMartin Odersky2015-03-182-22/+27
| | | | | | | ... 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.
* Print templates again in sugared form.Martin Odersky2015-03-181-3/+5
|
* Pass the correct context down in tree accumulators.Martin Odersky2015-03-181-81/+88
|
* Tweaks to printingMartin Odersky2015-03-182-67/+87
| | | | | | | | - 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.
* Run unpickler tests in next run.Martin Odersky2015-03-181-14/+20
| | | | Will get cross-talk ob cached symbols otherwise.
* Bugfixes in unpicklingMartin Odersky2015-03-187-36/+67
| | | | | | | | | - 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.
* Fix implicit problem in RefinedPrinter.Martin Odersky2015-03-182-6/+6
| | | | | | | 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.
* Don't suppress ambiguous implicit notes.Martin Odersky2015-03-181-1/+1
| | | | | Ambiguous implicits notifcations for selection views were propagataed to adapt but then dropped.
* Align PickleFormat with doc specMartin Odersky2015-03-182-186/+180
| | | | | | New version number: 0.04 Also removed dead code in pickler.
* Pickle trait flag and compute PureInterface and NoInits in unpickler.Martin Odersky2015-03-185-28/+46
| | | | | | 1) Trait was missing, needs to be serialized. 2) The other two flags are not serialized, need to be reconstituted on unpickling.
* Set NoInits also for non-trait classesMartin Odersky2015-03-181-6/+4
| | | | The flag seems useful also for plain classes. No reason to restrict to traits.
* Tweaks to printingMartin Odersky2015-03-182-12/+11
| | | | | 1) Remove special treatment of PlainPrinter <module>.this. 2) Always use symbol mods when a symbol is available.
* Added testing hooks for unpicklerMartin Odersky2015-03-187-27/+67
| | | | New option -Ytest-pickler compares trees before and after pickling.
* Ensure that start position is <= end position in ParserMartin Odersky2015-03-181-1/+1
|
* Added pickling part of new scheme.Martin Odersky2015-03-185-108/+54
|
* Finished new position unpickling code.Martin Odersky2015-03-186-118/+97
| | | | Pickling still has to be written.
* Companion objects of abstract case classes are not functions.Martin Odersky2015-03-182-2/+5
| | | | | They do not have a generated apply method, so cannot be functions. Problem was unvovered when changing the definition of LazyAnnotation.
* Bugfix: Take account of asSeenFrom in matchingDenotationMartin Odersky2015-03-182-9/+13
| | | | | | | 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.
* Bugfix: Avoid importing constructorsMartin Odersky2015-03-181-1/+1
| | | | We got an ambiguous import error in PositionReader before.
* Avoid capturing context in lazy treesMartin Odersky2015-03-1812-74/+82
| | | | | | | | | | | | | | | | | | 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.
* Handle ParsedTry nodes in RefinedPrinterMartin Odersky2015-03-181-0/+4
| | | | Used to print in raw form only.
* Halfway to yet another scheme for handling positionsMartin Odersky2015-03-184-20/+57
| | | | | | | | | | 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.
* New scheme for recording positionsMartin Odersky2015-03-1812-167/+194
| | | | Single traverser, also handles lazy trees.
* Various fixes to unpicklingMartin Odersky2015-03-186-48/+64
| | | | | | | 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
* Fixed bugs related to Unpickling.Martin Odersky2015-03-183-41/+51
|
* Save pickled bytes in compilation unitMartin Odersky2015-03-182-0/+6
|
* Have pkg intsead of static external referencesMartin Odersky2015-03-184-13/+23
| | | | | Static does not tell us whether to start the search it in empty package or in root package.
* First version of unpickler for PositionsMartin Odersky2015-03-187-674/+715
| | | | Refactored unpickling, splitting into several files.
* Fix implementation of readEndMartin Odersky2015-03-181-1/+1
|