aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/ast/TreeTypeMap.scala
Commit message (Collapse)AuthorAgeFilesLines
* CleanupsMartin Odersky2016-10-021-1/+0
| | | | | Better comments and refactorings that move some things around so that less modules depend on Inliner.
* Move logic from InlineInfo to BodyAnnotMartin Odersky2016-10-021-4/+3
| | | | Now that we have BodyAnnot, InlineInfo can be eliminated.
* Use BodyAnnot to indicate rhs of inline methodMartin Odersky2016-10-021-4/+1
| | | | | | 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/+8
| | | | | | | | 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.
* Fix some problems in InlinerMartin Odersky2016-10-021-0/+4
| | | | | | | | | | | | | | 1. Don't retypecheck the arguments of an inlined epressions. These might be very large (e.g. inlined track, or traceIndented in dotty)/ 2. Keep track of inlined calls in context instead of Inlined nodes. We only need the to compute the source file, the rest is irrelevant. 3. In Def bindings of inlined by-name parameters, change owner of right hand side. Otherwise we get incorrect owner chains. 4. In TreeTypeMap, treat Inlined in the same way as a block.
* Drop debug printlnMartin Odersky2016-03-121-1/+0
|
* Refinement to TreeTypeMapMartin Odersky2016-03-121-1/+3
| | | | | When recursing in a template body, need to update the context's owner, so that `ref` can work correctly.
* Correct a large number of typos.Jason Zaugg2015-05-141-1/+1
| | | | | I scanned the main sources with IntellIJ's spell checker and corrected what showed up.
* Re-enable testsMartin Odersky2015-05-111-2/+0
| | | | | Most tests were still commented out in last merge. Also, an outdated comment in TreeTypeMap was removed.
* Rename -YnoDoubleBindings to -Yno-double-bindingsMartin Odersky2015-04-091-1/+1
| | | | | | | This aligns with the "-" instead of CamelCase convention for the other command line options. Also, enable -Yno-double-bindings for dotc_core.
* Make some tree fields lazyMartin Odersky2015-03-181-4/+4
| | | | | | | | | | | | | | | | 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.
* More careful usage of unforced decls in classes.Martin Odersky2014-12-181-1/+1
| | | | | | | | | | 1) Rename `decls` to `unforcedDecls` to make it clear that it is danegrous to use. 2) Prefer `info.decls` over `unforcedDecls`. This fixes the problem reported in #305 where the primary constructor was not found.
* Drop modifiers as separate data from MemberDef treesMartin Odersky2014-11-101-2/+2
| | | | Typed MemberDef trees now take the modifiers from their symbol's data.
* Fix to TreeTypeMapMartin Odersky2014-10-261-28/+16
| | | | | | | Now handles the case where a class symbol itself is not changed by the map, but one of its declarations is. In this case we need to back out, and create new symbols for the class and all other symbols that are defined in the same scope as the class.
* TreeTypeMap needs to map declarations of mapped classesMartin Odersky2014-10-261-12/+39
| | | | | | | | ... and these mappings have to be part of the applied substitutions. Without the patch, the postCondition of FirstTransform fails for TreeInfo.scala and others, because it selects symbols which are not defined in the mapped class. Unrelated bugfix: JavaArray derives from Object.
* New utility methods in SymUtilsMartin Odersky2014-10-111-7/+2
|
* Fixed assertion to enfornce idempotency of substitutionsMartin Odersky2014-10-111-2/+2
|
* Better TreeTypeMapsMartin Odersky2014-09-131-18/+62
| | | | | | | | | | | | | | | | 1. They now keep track of changed constructors in templates, updating the class scope as for other members. 2. Any changed members are now entered into the new class scope at exactly the same position as the old one. That ensures that things like caseAccessors still work. 3. ChangeOwners now is reflected in the prefixes of any named types. 4. Newly created classes now get their own ClassInfo type. 5. TreeTypeMaps always crete "fresh" symbols. Fresh symbols do not share a NamedType reference with an existing reference to some other symbol. This obviates b2e0e7b4, which will be reverted. To make it work, the interface of TreeMap changed from an ownerMap function to a substitution-like data structure working with two lists.
* Fix class decls in TypeTypeMapMartin Odersky2014-09-101-0/+6
| | | | | | If definitions in a class are substituted by TreeTypeMap, the new symbols have to show up in the `decls` scope of the class instead of the old ones.
* Check that idents don't assume magic.Martin Odersky2014-08-241-0/+2
| | | | | | In TreeChecker, make sure that every identifier has a type with an elidable prefix. This excludes identifiers pointing to members of random prefixes without making the prefix explicit in the tree as part of a Select node.
* Refactored TreeTypeMapMartin Odersky2014-08-181-0/+120
Goes into a separate source files. Several simplifying refactorings.