aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* | Fix Ycheck printing a lot of error about symbols that don't actually exist.Dmitry Petrashko2015-03-191-1/+1
|/
* Merge pull request #394 from dotty-staging/add/unpicklingDmitry Petrashko2015-03-1873-538/+3823
|\ | | | | Add/unpickling
| * Fixing conflicts between #361 and #394Dmitry Petrashko2015-03-181-1/+1
| |
| * Bringing back fix to TreeMap.transform(ValDef) that was lost during rebaseDmitry Petrashko2015-03-181-1/+1
| |
| * Tweaks to pickle formatMartin Odersky2015-03-186-17/+17
| | | | | | | | | | MODULE -> OBJECT, as suggested by Simon. Header is 4 hex digits, not 8 chars.
| * Added missing patch to DefaultInit drop.Martin Odersky2015-03-181-1/+0
| |
| * Simplifications to pickled flagsMartin Odersky2015-03-184-32/+27
| | | | | | | | | | 1) Avoiud serializing redunant flags that come with modules 2) Drop DEFAULTinit flag - it's not used.
| * Drop environment from pickled closures.Martin Odersky2015-03-182-9/+9
| | | | | | | | It is always empty anyway. Side benefit: We can get rid of NOTYPE, too.
| * Change to PickleFormatMartin Odersky2015-03-184-8/+6
| | | | | | | | | | Remove 3rd argument of BIND types. It can be reconstructed on unpickling.
| * Add support of Shadowed names to TastyPrinterMartin Odersky2015-03-181-0/+1
| |
| * Simplifications to TASTy formatMartin Odersky2015-03-183-19/+14
| | | | | | | | | | 1) Drop the length field of BYNAMEparam 2) Eliminate EMPTYTREE
| * Remove Throw from picklingMartin Odersky2015-03-183-8/+0
| |
| * Two more tweaks to make pickling invariant under printingMartin Odersky2015-03-183-5/+16
| | | | | | | | | | | | | | | | | | 1) DefDefs with implicit method types generate implicit parameters 2) Super accessors are inserted after class parameters. With these changes files in core also print the same after pickling, with the exception of Types and TypeOps which have some spurious differences: Types are equal but appear in more simplified form after pickling.
| * Homogenize printing of super calls.Martin Odersky2015-03-181-9/+10
| |
| * Homogenize package ids and literalsMartin Odersky2015-03-181-3/+10
| | | | | | | | | | | | | | | | | | The unpickled term in a package id is different from the original but the type is the same. In a literal prefer constants in the types over thsoe in the terms. With this change, we get identical typed tree output also for core/pickled.
| * Further harmonization between typing and unpicklingMartin Odersky2015-03-181-3/+5
| | | | | | | | | | 1) Prefixes in selections are widened if unstable 2) DefDefs get Method flag set
| * Drop choice of separator in expanded name.Martin Odersky2015-03-185-14/+17
| | | | | | | | | | It's not used and is too low-level anyway. Expanded names should be a semantic concept, the choice of separator is irrelevant.
| * Pickle signatures using qualified names.Martin Odersky2015-03-182-2/+10
| | | | | | | | | | Would like to do use more semantic names in pickled file, but it's hard without having semantic names to start with.
| * Harmonize treatment of simplified between typer and unpicklerMartin Odersky2015-03-182-5/+5
| | | | | | | | | | | | | | | | We got some spurious differences in the types in TemplateParents because simplification was done in Typer but not in Unpickler. With the change we get perfect matches for all files in pickleOK also if we print their types.
| * Fix unpickling parameter aliasesMartin Odersky2015-03-181-3/+7
| | | | | | | | The type of a parameter alias is an ExprType, was the underlying type.
| * Pickle shadowed namesMartin Odersky2015-03-186-7/+33
| | | | | | | | | | | | | | | | | | Shadowed names in types need to be pickled and treated on unpickling. We choose to make Shadowed a separate TastyName class, to avoid the ad-hoc name-mangling in current dotc. When names are redone Shadowed will also become a special class in the compiler proper.
| * Rename inheritedName -> shadowedNameMartin Odersky2015-03-184-7/+7
| | | | | | | | The new name is more consistent with the usage (e.g. NamedType#shadowed).
| * Show compilation unit which failed pickling in tests.Martin Odersky2015-03-181-3/+3
| |
| * Fix to pickling literalsMartin Odersky2015-03-181-2/+7
| | | | | | | | | | | | | | | | Need to pickle the type, not the constant stored in the literal, because constant folding might have adapted the type, but leaves the constant value unchanged. An example is in pickleOK/unions.scala where a float 1.0f was adapted to Double, so should be pickled as a Double 1.0.
| * Re-org of pickling framework to enter before readMartin Odersky2015-03-184-73/+112
| | | | | | | | | | Need to enter all top-level symbols before reading any of them, in order to avoid stale symbols.
| * Refinements to pickling testing frameworkMartin Odersky2015-03-181-8/+5
| | | | | | | | | | | | | | We now unpickle all files first, and print afterwards. This helps in avoiding stale symbols that happen otherwise when we print a reference to a symbol that has not yet been unpickled. But it's not yet enough.
| * Don't print implicit for classes in homogenized viewMartin Odersky2015-03-181-1/+2
| | | | | | | | | | Implicits get pickled only for terms. So implicit class prints differently when unpickled.
| * Avoid treating setters as class parameters when picklingMartin Odersky2015-03-181-1/+2
| |
| * Harmonize parameterless constructors between unpickling and namerMartin Odersky2015-03-182-7/+11
| | | | | | | | | | | | Should get an () parameter list in both cases. (In fact, that's pretty annoying, it woul be better if we did not have this restriction. But in any case it has to be the same for Namer and Unpickler.)
| * Deal gracefully with out-of-scope references wehn unpicklingMartin Odersky2015-03-183-5/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Out-of scope references are evil but do arise. Dotc currently produces them in two cases (t1957.scala and Typer.scala) because it does not correctly hygenize dependent methods used as closurs. I beleive scalac wil generate them in more instances. The changes can produce dependent method types used in closures. Essentially the problem was that the depndency was not recognized in Typers when the closure was first created, because it badly interfered with type inference. But when unpickling the same closure the dependency is recognized. It's too late to fail now, we better deal with this gracefully. That's why there is now a mode bit "AllowDependentFunctions" which should be turned on only for unpickling, which reconstitutes dependent functions as closures without complaining.
| * Revert of interpolation decision when generating APPLIEDTYPEsMartin Odersky2015-03-181-1/+1
| | | | | | | | The previous setting did not generate same trees for Typer.scala
| * Systematic treatement of homogenized views in printingMartin Odersky2015-03-182-6/+13
| | | | | | | | | | | | | | | | | | | | | | A homogenized view makes sure that there are no spurious differences between trees before and after pickling. Currently there are two cases where homogenized is different from standard view: 1) Backquoted idents are not printed in backticks 2) Instantiated TypeVars so not get an apostroph.
| * 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
| |
| * 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-181-1/+1
| |
| * Compute PureInterface flag after pickling.Martin Odersky2015-03-186-52/+46
| | | | | | | | | | | | | | | | | | | | 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-181-19/+32
| | | | | | | | | | | | | | | | 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/+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-182-11/+22
| | | | | | | | | | 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.