aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/tasty
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #1588 from dotty-staging/fix-#1502odersky2016-10-161-5/+13
|\ | | | | Fix #1544: Allow long signatures in names
| * Fix #1544: Allow long signatures in namesMartin Odersky2016-10-131-5/+13
| | | | | | | | | | Fixes #1544 by making the length field use 1 or 2 bytes, depending on the number of parameters in a signature.
* | Merge GenericType, TypeLambda and PolyTypeMartin Odersky2016-10-122-6/+3
|/
* Move logic from InlineInfo to BodyAnnotMartin Odersky2016-10-021-1/+0
| | | | Now that we have BodyAnnot, InlineInfo can be eliminated.
* Use BodyAnnot to indicate rhs of inline methodMartin Odersky2016-10-022-11/+11
| | | | | | Since fundamental operations such as treeCopy have to know about inline bodies, it seems better to represent this information directly in an annotation.
* Handle inlining in inlining argumentsMartin Odersky2016-10-021-1/+1
| | | | | | | | We got unbound symbols before because a TreeTypeMap would copy a tree of an inline DefDef but would not adapt the inline body stored in the @inline annotation of the DefDef to point to the updated tree.
* Always use implicit context at the current periodMartin Odersky2016-10-021-2/+5
| | | | | | | | | | | | | | | An implicit method might be unpickled in one run and the implicit body might be selected first in a subsequent run. In that case the inlined code was read with the original context, but that context needs to run at the current period. This resulted in denotation out of date errors in bringForward. Another problem with this design was space leaks: An context might survive multiple runs as part of an ImplicitInfo of an unpickled method. The new design avoids both problems. Implicit contexts are always up to date and leaks are avoided.
* Refactoring for registering InlineInfoMartin Odersky2016-10-021-5/+3
| | | | | | Now it's done on the symbol directly rather than its inline annotation. This simplifies client code and keeps the implementaion how inline infos should be assocated with inline methods open.
* Better names and documentation for Inliner.Martin Odersky2016-10-021-1/+1
|
* Add accessors for non-public members accessed from inline methodsMartin Odersky2016-10-022-3/+3
| | | | | | | | This makes existsing uses of inline mostly compile. Todo: Verify that stdlib can be compiled. Todo: Implement accessors for assignments to priavte variables Todo: Figure out what to do with accesses to private types.
* Better error message in TreePicklerMartin Odersky2016-10-021-2/+1
| | | | Print what was pickled when failing with unresoilvced symbols.
* Set the positions of inlined trees wehn read form TastyMartin Odersky2016-10-027-159/+100
| | | | | | | | | | | This required a major change in the way positions are handled, as the previous scheme did not allow to read the positions of arbitrary subtrees selectively. Fortunately, it's altogether a major simplification. Also, this fixed a bug in the previous scheme, where positions were generated before compactification, resulting in addresses being wrong.
* Support separate compilationMartin Odersky2016-10-021-0/+7
| | | | | Inline trees can now be read form TASTY. However, positions are not set correctly. This remains to be implemented.
* Add Inlined tree nodeMartin Odersky2016-10-021-0/+10
| | | | | | | | | ... to tag inlined calls. Perform typings and transformations of inlined calls in a context that refers to the INlined node in its InlinedCall property. The idea is that we can use this to issue better error positions. This remains to be implemented.
* Make namePos a member of memberDefMartin Odersky2016-09-291-1/+4
| | | | | That way it can be accessed by other parts which deal with error messages.
* Make Modifiers untyped only.Martin Odersky2016-09-281-2/+2
| | | | | The typed variant is no longer needed. This means modifiers can safely be ignored in typed trees if we so choose.
* Drop PairMartin Odersky2016-09-253-10/+4
| | | | | | | | Drop tree node class 'Pair'. It was used only in imports, where it can easily be replaced by Thicket. The envisaged use for generic pairs is almost sure better modelled by a "Pair" class in Dotty's standard library.
* Drop Config.checkKindsMartin Odersky2016-07-112-6/+2
| | | | | Allows us to drop also the involved knownHK method. Lots of other cleanups.
* Get rid of BindingKindMartin Odersky2016-07-113-6/+2
| | | | | Under direct hk encoding this is no longer needed. Also, drop now redundant pieces of widenForMatchSelector.
* Remove refinement encoding of hk typesMartin Odersky2016-07-111-1/+1
| | | | | | | | | | Remove the code that implemented the encoding of hk types using refinements. Drop the notion that RefinedTypes can be type parameters. This is no longer true under the new representation. Also, refactoring MemberBinding -> TypeParamInfo
* Fix parameter unpicklingMartin Odersky2016-07-111-10/+10
| | | | | | | | Parameter names always come in as term names, ahve to be explicitly converted to type names. The previous implementation used a cast instead of a conversion, which caused a ClassCastException. For symmetry we model readParamNames such that it returns a List[Name] which has to be explicitly converted to a List[TermName] or a List[TypeName], using a map.
* Refactoring of PolyType and TypeLambdaMartin Odersky2016-07-111-1/+1
| | | | | | | Make them each inherit from common BaseType GenericType. That way we avoid inheriting accidentally stuff from PolyType in TypeLambda. Also, Fix adaptation of type lambdas. Don't confuse them with PolyTypes.
* Start new, direct HK schemeMartin Odersky2016-07-113-1/+21
| | | | | - Re-introduce newHK option. Label some things that will be removed with OLD.
* Remove old hk schemeMartin Odersky2016-07-113-15/+4
| | | | | | | | | | | | - Simplify RefinedType - Drop recursive definition of RefinedThis - this is now taken over by RecType. - Drop RefinedThis. - Simplify typeParams The logic avoiding forcing is no longer needed. - Remove unused code and out of date comments.
* Change testsMartin Odersky2016-07-111-0/+4
| | | | | | | | | | | | | | | | - compileMixed failed because there was a cycle between immutable.Seq (compiled) and parallel.ParSeq (loaded from classfile). Inspection of the completion log (turn completions Printer on) and the stack trace showed that there's nothing we can do here. The old hk scheme did not go into the cycle because it did not force an unrelated type. I believe with enough tweaking we would also hva egotten a cycle in the old hk scheme. The test is "fixed" by adding parallel.ParSeq to the files to compile. - Disable named parameter tests Those tests do not work yet with the revised hk scheme. Before trying to fix this, we should first decide what parts of named parameters should be kept.
* Turn on new hk schemeMartin Odersky2016-07-111-2/+2
| | | | | | | For the moment under newHK flag. - avoid crasher in derivedTypeParams (NamedTypes don't always have symbols) - Revise logic in type comparer for new HK scheme
* Introduce recursive typesMartin Odersky2016-07-113-3/+20
| | | | | | | | | | | | | | | | | Map self-references in refinements to recursive types. This commit does this for refinement types appearing in source. We still have to do it for unpickled refinements. Test apply-equiv got moved to pending because it simulates the old higher-kinded type encoding in source, which relies on the old representation in terms of self-referential refinement types. The plan is not to adapt this encoding to the new representation, but to replace it with a different encoding that makes critical use of the added power of recursive types. Use recursive types also when unpickling from Scala 2.x. Add mapInfo method to Denotations.
* Allow general recursion in refined types.Martin Odersky2016-07-111-1/+1
| | | | | Treat parent like refinedInfo. Introduce isBinding convenience method in TypeBounds.
* Allow refinements of new typesMartin Odersky2016-07-113-3/+11
| | | | | | Previously a refinement could only apply to a type bound in the parent. This restriction needs to be dropped for the new encoding of hk type parameters.
* Fix typos in commentsMartin Odersky2016-05-231-2/+2
|
* Make isCOmpanion test cheaperMartin Odersky2016-05-231-6/+27
| | | | | | | As explained in the comment, a scalacLinkedClass must also be a true companion unless the original symbol is a root. This avoids us to drop the (potentially large) unpickled map and save some memory.
* Remember owner in completerMartin Odersky2016-05-231-4/+4
| | | | | | Otherwise we might get a false owner if completing from somewhere else. We do not have a failing test to demonstrate the problem, but it looks like the right thing to do.
* Refine owner trees for templatesMartin Odersky2016-05-231-1/+1
| | | | | Include member defs inside templates in the enclosing class, otherwise they would get localDummy as onwer.
* Adopt new scheme for handling forward references in TastyMartin Odersky2016-05-231-66/+106
| | | | | Instead of stubbing with potentially wrong owners and hping for the best, we now compute owners on demand, using the lazy data structure of an OwnerTree.
* Maintain ownerTree data structure when unpickling TastyMartin Odersky2016-05-233-6/+87
| | | | | | First step for a more robust scheme to access symbols in Tasty. This entailed a swap of two fields in RefiendType, to make tree format more uniform in what concerns where references are found.
* Let createSymbol return a symbolMartin Odersky2016-05-231-23/+24
| | | | | | Compute initialization flags of possibly enclosing traits elsewhere (in indexStats). Cleans up the logic and makes the module more understandable.
* Make sure delayed Tasty unpicklings are done at the latest at Pickler phaseMartin Odersky2016-05-231-4/+6
|
* Disable stub checkingMartin Odersky2016-05-231-4/+13
| | | | | | | It caused an assertion error when separately compiling parts of dotty against TASTY information. Not sure the test achieves anything or whether it produces a false negative.
* Use source module ref as assumed self type when reading TastyMartin Odersky2016-05-231-2/+6
| | | | | | | | When reading Tasty we need to pre-set the info of a class to some ClassInfoType with (as yet) unknown parents and self type. But for module classes, we need to know the source module at all time, and this gets determined by the self type. So we now produce a TermRef for the assumed self type of a module class.
* Merge pull request #1219 from dotty-staging/fix-strawmansDmitry Petrashko2016-04-201-0/+2
|\ | | | | Fix strawmans
| * Create LambdaTraits referred to from UnpicklerMartin Odersky2016-04-151-0/+2
| | | | | | | | | | LambdaTraits are created on demand; we need to make sure they exist when referred to from Tasty.
* | Simplify handling of sourcefiles in Tasty infoMartin Odersky2016-04-092-17/+4
| | | | | | | | | | | | | | Instead of separate source file sections, pickle SourceFile as an annotation of all toplevel classes. We represent it like this anyway when reading back Tasty-defined classes.
* | Fix unpickling of Java SeqLiteralsMartin Odersky2016-04-071-3/+11
| | | | | | | | | | | | | | | | | | | | Two problems were fixed: - isJava needs to look at function symbol, not its type (references to Java methods get normal MethodTypes not JavMethodTypes) - we also need to handle the case where the repeated argument is wrspped in a type ascription.
* | Update TastyFormat for SeqLiteralMartin Odersky2016-04-071-1/+1
| | | | | | | | SeqLiteral have an elemTpt, which was missing in format.
* | Fix flags when unpickling setters of parameter accessorsMartin Odersky2016-04-071-0/+5
| | | | | | | | | | | | ParamAccessor is not a pickled flag. This is not a problem for normal parameter accessors which are pickled as PARAM fields. But setters of parameter accessors also need to have the flag set (and Deferred reset).
* | Take SourceFile annotations into account when computing sourceFileMartin Odersky2016-04-071-1/+1
| | | | | | | | | | | | | | If a file was loaded from TASTY, it can not still have a non-null source file, since the source file is unpickled into the annotation of a top-level class. Also, fix typo in previous commit.
* | Add unpickled source file path as annotation to root symbolsMartin Odersky2016-04-071-4/+8
| |
* | Fix reading of SourceFile attribute from TastyMartin Odersky2016-04-071-2/+4
|/ | | | The previous path name always had a "Simple(...)" wrapped around it.
* Move Mode to coreMartin Odersky2016-04-011-1/+0
| | | | | Mode is used from a lot of low-level code, does not just reflect Typer info. So it makes more sense top to place it in the core package.
* Merge pull request #1166 from dotty-staging/fix-#1136odersky2016-03-182-4/+5
|\ | | | | Fix typing of SeqLiterals