aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Add unique ids for definitionsMartin Odersky2014-07-171-3/+5
| | | | If -uniqid is on, RefinedPrinter now prints unique ids in definitions.
* Avoid some classes of StaleSymbol errorsMartin Odersky2014-07-172-5/+31
| | | | | | | | If a symbol is defined in phases M..N, and that symbol is then accessed in a phase before M, but in a new run, we should not issue a stale symbol error (after all, the symbol is not defined yet). Instead we now return a NoDenotation.
* Make more Definition methods depend on implicit context argumentMartin Odersky2014-07-171-5/+5
| | | | | | | | | The problem is that exploration methods are run and phase dependent, whereas Definitions has an implicit context that freezes the period when Definitions ewas created. We should complement this by splitting Definitions into a global and per/run part, but that is independent of the change in this commit.
* Fixes to MacroTransform and TreeTransformerMartin Odersky2014-07-172-4/+20
| | | | | | | 1) Make local context go to module class if the tree symbol is a package val. Perviously, this gave the wrong context owner for package definitions. 2) Add a hook to define the phase in which a transform should be run.
* Invalidate member caches in different periodsMartin Odersky2014-07-171-2/+10
| | | | | | | | | A membercache is not valid in a period different from the one it was created in. Reason: The denotations stored in the cache might have different infos in different periods. Also: add maybeOwner convenience method for printing, which handles NoDenotation/NoSymbol gracefully.
* Make TypeParamCreation flags depend on ownerMartin Odersky2014-07-176-6/+13
| | | | | | Type params should have different flags, depending on whether they are owned by a method or a class. Only class type parameters are marked Deferred, protected, and Local.
* Add definedPeriodsString method for disgnostics.Martin Odersky2014-07-171-19/+16
|
* Move valueclass functionality into its own ValueClass module.Martin Odersky2014-07-177-35/+53
|
* Fix bad type passed to indexOf.Martin Odersky2014-07-171-1/+1
| | | | This is a trap waiting to happen elsewhere as well. Not clear how to avoid it.
* Revised purity tests in TreeInfoMartin Odersky2014-07-173-29/+58
| | | | | | | | | Added two levels: pure and idempotent and fixed what look like obvious bugs. It seems the previous treatment confused the two levels. Changed EtaExpansion and Erasure to use Pure instead of Idempotent where appropriate.
* New Flag: InlineMartin Odersky2014-07-171-6/+9
| | | | | | Added now because it affects purity if expressions: Inlined pure values are pure even if referenced from impure prefixes (i.e. prefix need not be evaluated).
* New micro phase: LiteralizeMartin Odersky2014-07-172-1/+67
| | | | Convert expressions with constant types to Literals.
* Added infix methods for some tree constructionsMartin Odersky2014-07-1712-67/+85
| | | | | | | 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.
* ExtensionMethods phase and TypeUtilsMartin Odersky2014-07-175-3/+293
| | | | | | | | | | | | New phase for extension methods. Also, split off some type handling functionality that can be used elsewhere in new TypeUtils decorator. The idea is that TypeUtils should contain methods on Type that make sense specifically for transformations. That way, we can keep Types from growing. Might make sense to do similar decorators for Denotations as well. There's a bug fix in MacroTransform: Need to treat selfInfo varDels specially, since they have no symbol.
* Various cleanups and utility additionsMartin Odersky2014-07-1711-41/+116
| | | | | | | - 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
* Changed PostTyperTransformer schemeMartin Odersky2014-07-1710-159/+87
| | | | | | | | | | | | 1) We now always generate companion objects for classes. This is done in mini-phase "companions", which also assures that companion-modules appear after companion-classes. 2) PostTyperTransformers is gone; the part which normalizes trees has been rolled into TreeTransform and the part which reordered companion classes and modules is now in Companions. Note: Some tests were deisabled; should be re-enabled by Dmitry where needed.
* Removed test caseMartin Odersky2014-07-171-17/+0
| | | | | d.T is an access to a structural type member, so rejecting this is OK. Not sure why we compiled this before without warning.
* Fixed problem with installAfterMartin Odersky2014-07-171-2/+30
| | | | | | The problem is that when an installAfter completely replaces a previous denotation, a symbol or NamedType might still hang on to that denotation in the cache. We need to enforce that we switch to the new denotation. This is done by setting the replaced denotation's validFor field to Nowhere.
* Rename SignedType -> MethodicTypeMartin Odersky2014-07-174-11/+11
| | | | | ... for the common supertype of MethodType, PolyType, and ExprType. Signed was confusing.
* Added phase: SuperAccessorsMartin Odersky2014-07-1712-15/+651
| | | | | Rewrote SuperAccessors (more to be done; see comments), and added stuff here and there to make it work smoother.
* Improved printing of flagsMartin Odersky2014-07-172-4/+15
| | | | | | (1) Make sure ModifierFlags is TermFlags and TypeFlags (2) Shorten private <local> to private[this]; same with protected (3) Print [this] for local symbols in RefinedPrinter
* Error method for implementation restrictionsMartin Odersky2014-07-171-0/+3
|
* ThisType trees have their class as a denotationMartin Odersky2014-07-171-0/+1
| | | | Added this case, so that .symbol on a ThisType returns the underlying class.
* New utitility methods in tpd.Martin Odersky2014-07-172-4/+17
| | | | | | | | | Added the following utility methods: - polyDefDef: Create a DefDef given a function that takes type and value parameters and yields a body. - appliedToTypeTrees: Apply function to type arguments ion a TypeApply if arguments are nonempty. - mkAsInstanceOf - ensureConforms: generate a cast if expression has non-conforming type.
* Added MacroTransform as a transformer template for macro phases.Martin Odersky2014-07-172-0/+56
|
* Make SuperAccessorName and extractor.Martin Odersky2014-07-171-5/+7
| | | | Should do the same with other name-creator/name-test pairs.
* Add cloneScope method and handle versioning of ClassInfo#declsMartin Odersky2014-07-173-8/+9
| | | | | This is done to streamline changing class denotations in new phases by adding to (or otherwise modifying) their decls scope.
* Merge pull request #142 from DarkDimius/fix-transforms-periododersky2014-07-175-10/+40
|\ | | | | Fix using of wrong period for creating nested ctx in TreeTransforms
| * Phases in tests now also have valid periods.Dmitry Petrashko2014-07-164-0/+23
| |
| * Fix wrong period for creating nested ctx in TreeTransforms.Dmitry Petrashko2014-07-161-2/+5
| | | | | | | | | | | | | | `owner` for nestedContext in `TreeTransforms` was assigned using initial period of whole `TreeTransforms` block. That is incorrect as denotation for this owner could have been create by some phase in this block.
| * Short-circuit TreeTransform.transformDmitry Petrashko2014-07-161-5/+7
| | | | | | | | No need to perform zero transformations.
| * Short-circuit transformSingleDmitry Petrashko2014-07-161-5/+7
| | | | | | | | There is no need to recurse in tree if there are no transformations left.
* | Merge pull request #135 from dotty-staging/docs/higher-kinded-v2odersky2014-07-141-0/+375
|\ \ | |/ |/| Docs/higher kinded v2
| * Sync with implementationMartin Odersky2014-07-141-51/+100
| | | | | | | | Adapted docs so that they reflect what has been implemented.
| * fixed typosMartin Odersky2014-05-301-5/+5
| |
| * Fixed typosMartin Odersky2014-05-301-7/+7
| |
| * Version 2, picking up on an idea of Adriaan.Martin Odersky2014-05-301-0/+326
| |
* | Merge pull request #137 from dotty-staging/change/higher-kindedDmitry Petrashko2014-07-0939-678/+888
|\ \ | | | | | | Change/higher kinded
| * | Added test case for LMS inspired HK code.Martin Odersky2014-06-261-0/+43
| | | | | | | | | | | | Closes #94.
| * | Improved documentationMartin Odersky2014-06-263-5/+17
| | | | | | | | | | | | Added explanations where suggested by Adriaan in his review.
| * | Bring LambdaClass inline with its doc comment.Martin Odersky2014-06-261-4/+3
| | | | | | | | | | | | | | | Avoid special treating TermRef, as this is not demanded by the comment and does not change any of the test outcomes.
| * | Avoid crashing on name tests when name is empty.Martin Odersky2014-06-261-4/+4
| | | | | | | | | | | | Guard every occurrence of name.head with a test whether name.length > 0
| * | Avoid caching values that depend on typevar state.Martin Odersky2014-06-204-27/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TypeVars flip from the initial state, where underlying == origin to the final state where underlying == inst. This flip can invalidate information that depends on the underlying type of a TypeVar. Since we do not know when the flip occurs, we need to avoid keeping any such information in a cache. The commit makes three caches depend on a new value: typerState.ephemeral. The value is set to `true` each time we follow the underlying type of a TypeVar, and this disables cached information to be retained. A test case for this commit is t2693.scala. This test passes typechecking with the previous commit, but fails in -Ycheck:front because of stale cache info in an "#Apply" typeref. The present commit fixes that.
| * | Make refines work for aliasesMartin Odersky2014-06-201-17/+21
| | | | | | | | | | | | refines needs to be made more stable, so that also aliases and derefernces typevars are recognized as prefixes.
| * | Add missing case where isHKSubType is neededMartin Odersky2014-06-201-4/+5
| | | | | | | | | | | | Was not called when comparing a named type with an #Apply projection. The commit fixes this.
| * | Fixes to lambda abstractionMartin Odersky2014-06-194-6/+17
| | | | | | | | | | | | | | | | | | 1) Honor variance of Apply and $hkArgs when instantiating them 2) Eta-lifting a higher-kinded type is straight eta expansion, no arguments are applied.
| * | Prevent a source of CyclicReference in refined printerMartin Odersky2014-06-191-1/+1
| | |
| * | Delete old, disabled code in TypeComparerMartin Odersky2014-06-181-284/+1
| | |
| * | Handling higher-kinded types with lambdasMartin Odersky2014-06-1823-345/+430
| | | | | | | | | | | | | | | Switch to the new scheme where higher-kinded types (and also some polymorphic type aliases) are represented as instances of Lambda traits.
| * | Fixing subtyping of refined typesMartin Odersky2014-06-151-40/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refined type subtyping needs to take into account all information that was seen about members of both refined types. This is handled by storing context info in `pendingRefinedBases` and making use of this to selective rebase qualifiers when comparing refined types. Note: This commit fails in pos/collections and dotc/ast, presumably because of bad interaction between the refined subtyping and the "matchingNames" logic (which will go away).