aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/transform/SuperAccessors.scala
Commit message (Collapse)AuthorAgeFilesLines
* Handle outer this in InlinerMartin Odersky2016-10-021-1/+1
| | | | Also, do some refactorings and fix some bugs in Inliner.
* Refactorings of GenericTypes and underlying/upperboundMartin Odersky2016-07-111-6/+0
| | | | | | | 1. Make genericType a trait instead of a class. 2. Make TypeLambda a type proxy 3. Split underlying in TypeProxy into underlying and superType 4. Cleanups in many other places
* Turn println into logMartin Odersky2015-12-191-1/+1
|
* Fix sleeper bug in ParamForwardingMartin Odersky2015-12-141-1/+2
| | | | | | | | | ParamForwarding converts some parameters to nullary methods, yet it does not update the references to these parameters. Their signature is still NotAMethod, which is wrong. Causes subtle differences in peckle tests: a param accessor get type T before pickling (which is wrong), gets => T when reading back (which is right). Test case in pickling/selfSym.scala.
* Fix test when abstract override is needed.Martin Odersky2015-08-211-1/+1
| | | | | There was a transcription error from scalac which caused the scope of a `!` to be wrong.
* Expand names of super accessorsMartin Odersky2015-08-211-2/+4
| | | | | | | | Scalac seems to treat superaccessors of traits in a rather peculiar way. They are left unexpanded so that a class implementing several traits with the same superaccessors will get duplicate methods with the same name. It seems this is then resolved in the backend. Here we solve the issue by expanding the names of trait super accessors immediately.
* SuperAccessors: Do not create abstract private members.Dmitry Petrashko2015-05-031-2/+2
|
* Update comments on ParamForwarding and SuperAccessors.Dmitry Petrashko2015-04-281-1/+1
|
* Remove trailing whitespaceMartin Odersky2015-04-231-14/+14
| | | | | I have figured out how to make this the default in Eclipse, so hopefully we won't see many repeats of this.
* Super accessor refactoringMartin Odersky2015-04-221-179/+174
| | | | | | | | | New phase: PostTransform, runs after Typer. SuperAccessors and ParamForwarders (renamed from ForwardParamAccessors) are helper objects of post transform. Next: Add instChecks as well.
* Be smarter about validity of ownersMartin Odersky2015-04-221-31/+28
| | | | | | | | | | | | | | | Previous scheme never went back once owner was taken to be invalid: all enclosed code was assumed to be with invalid owners. This is not true if the enclosed code contains a class or method. Also previous scheme looked at the owner, whereas the only thing that matters is the enclosing class. Therefore, by-name arguments are no longer considered to be regions with invalid owners. Also: run everything at thisTransform.next, except install forwarders at thisTransform. Previous scheme was weird in that it switched to thisTransform.next in an Apply node, but never switched back, even if said Apply node contains nested classes that need forwarders.
* Drop restriction that SuperAccessors should not touch patternsMartin Odersky2015-04-221-5/+0
| | | | | | | | | | | Not sure why we need to do this, and in any case it's not sure what constitutes a pattern. There are certainly some parts of patterns (e.g. prefixes of unapplies, or their implicit arguments) that should be transformed under SuperAccessors, so the previous condition was too coarse. We include the test case that motivated the restriction. It looks like it works now.
* Move checkCompanionNameClashes from SuperAccessors to RefChecksMartin Odersky2015-04-221-64/+1
| | | | Done in the interest of slimming down and modularizing SuperAccessors.
* Breakout and re-enable forward param accessors code.Martin Odersky2015-04-221-75/+9
| | | | | | | | | | The code got accidentally disabled when refactoring SuperAccessors for pickling. The forwardParamAccessor method was applied only to non-parameters where it is the identity (we really shopuld get test paramAccessors working, then this would not have happened. In the interest of better modularity, the code was placed in its own trait, because it overlaps only marginally with the rest of SuperAccessors functionality.
* New utility method in TypeUtils: ensureMethodicMartin Odersky2015-04-221-4/+4
| | | | Used in at least two places, so it's of general use.
* Ensure spaces after `if` in Dotty source.Dmitry Petrashko2015-04-091-1/+1
|
* Add spaces around + in dotty source.Dmitry Petrashko2015-04-091-1/+1
|
* Two more tweaks to make pickling invariant under printingMartin Odersky2015-03-181-2/+11
| | | | | | | | | 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.
* Make some tree fields lazyMartin Odersky2015-03-181-2/+2
| | | | | | | | | | | | | | | | 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.
* New method on scopes: openForMutationsMartin Odersky2014-12-181-1/+1
| | | | Replaces `asInstanceOf[MutableScope]` calls.
* Make sure all non-deferred methods are implementedMartin Odersky2014-12-031-1/+2
| | | | | | | | | Checked by a new post condition after memoize. Two bugs were detected and fixed by the condition (1) Memoize did not implement getters and setters of ParamAccessors (2) ResolveSuper did not implement super accessors in non-trait classes.
* 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.
* Superaccessors are methodsMartin Odersky2014-11-091-1/+1
| | | | Need to have Method flag set
* Bugfix for superaccessorsMartin Odersky2014-11-091-1/+1
| | | | Threw away list of constructed statements.
* Make ThisTypes take TypeRefs instead of ClassSymbolsMartin Odersky2014-08-271-1/+1
| | | | | This avoids stale symbol errors and does not need the somewhat unsystematic symbol rebinding of the last commit.
* Rename in Phase: name -> phaseNameMartin Odersky2014-08-181-1/+1
| | | | | Most transformations are subclasses of phase. Having a generic name like `name` in scope everywhere is therefore very risky.
* Extend retyping to more copy methods.Martin Odersky2014-08-151-1/+3
| | | | | | | | We now retype basically everything except leave nodes and definitions. This provides for more robust tree copying and transformation. It also flushed out errors in SuperAccessors (fixed by a hack, awaiting systematic phase change there) and UnCurryTreeTransform. Uncurry is disabled for now, will be fixed shortly.
* Make typed tree copiers selectively retype nodes.Martin Odersky2014-08-151-1/+1
| | | | | | Those nodes that had so far a propagateType method defined on them are automatically retyped on copying. No more manual interventions are needed.
* Switched to new cpy scheme.Martin Odersky2014-08-131-1/+1
| | | | Avoid mentioning arguments that are unchanged.
* Changes to tree copyingMartin Odersky2014-08-131-6/+6
| | | | | | | | 1) Add copiers with default arguments, to avoid boilerplate 2) All copiers are now curried wrt first argument (which is the original tree). We already make use of the new features in cpy.DefDef, but not yet elsewhere.
* Added some more methods as infix tree operations:Martin Odersky2014-08-111-1/+1
| | | | | | asInstance/isInstance/ensureConforms/and/or. They replace some former "mk..." methods.
* Changed first phase normalization and improvements to TreeTransformMartin Odersky2014-08-031-1/+1
| | | | | | | | | | | | | | Two improvements to TreeTransform: 1) Added transformOther functionality which handles trees not handled by other parts 2) Passes down Mode.Pattern in the context when in a pattern. TreeTransform no longer normalizes unknown trees but passes them to transformOther. The former Companions phase has been renamed to FirstTransform. It now performs the following optimizations: - adds companion objects (this was done before) - other normalizations that were formally done in TreeTransform, - rewrite native methods to stubs (this was formally done in RefChecks)
* Added utility method: underlyingSymbolMartin Odersky2014-08-031-1/+1
|
* Preparation for intgeration of RefChecksMartin Odersky2014-08-031-1/+1
| | | | | Added OverridingPairs Small tweaks here and there.
* Move valueclass functionality into its own ValueClass module.Martin Odersky2014-07-171-1/+2
|
* Added infix methods for some tree constructionsMartin Odersky2014-07-171-8/+10
| | | | | | | Added several forms of "select" and "appliedTo" methods which construct Select, Apply, TypeApply trees. Motivation: Infix methods allow chaining which is more legible than deep nesting.
* Various cleanups and utility additionsMartin Odersky2014-07-171-10/+7
| | | | | | | - Some new functionality in tpd and in Symbols. - Added `sm` interpolator to print nicely. - Make use of nestedMap where possible. - Add IdentityDenotTransformer as a convencience class
* Rename SignedType -> MethodicTypeMartin Odersky2014-07-171-4/+4
| | | | | ... for the common supertype of MethodType, PolyType, and ExprType. Signed was confusing.
* Added phase: SuperAccessorsMartin Odersky2014-07-171-0/+557
Rewrote SuperAccessors (more to be done; see comments), and added stuff here and there to make it work smoother.