aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Fixes for type argument handling.Martin Odersky2014-11-153-8/+13
| | | | | | | (1) Type arguments now get a coordinate. (2) They are labeled Override (2) avoids having to special case TypeArgs in OverridingPairs.
* Fine-tuning override errors for syntehtic companion objectsMartin Odersky2014-11-142-10/+16
| | | | | | | These may raise real errors, so we cannot exclude them from overriding pairs a priori. But we can avoid reporting any errors if other override errors were reported previously for the same class.
* Refactored OverridingPairsMartin Odersky2014-11-141-36/+43
| | | | to make it easier to understand.
* Fix OverridingPairsMartin Odersky2014-11-142-16/+16
| | | | | | | | OverridingPairs had several bugs which caused pairs to be lost, which caused missing overrides checks. Fixing OverridingPairs revealed several test failures (and a problem in Synthetics generation which was fixed in the last commit). Tests that became negative are all moved into neg/overrides.scala, and the original versions in pos were fixed.
* Refine merge of nullary and parameterless denotations.Martin Odersky2014-11-141-1/+12
| | | | | | | | | | Previously, two denotations with types => T and ()T could not be merged, only their types could be, but then the denotation would no longer be a SymDenotation. We now treat the two types as equivalent so that it will select the symbol in a subclass. This fixes a problem where, once overrding pairs are made to work (see following commit), in core/Types we get an error "overriding final method "hashCode".
* Rename productArity in pattern matcher to prodArityMartin Odersky2014-11-141-16/+16
| | | | | | | | | | productArity is a method defined in ProductN which is inherited from case classes. It is possible that it will be usewd in the implementation of pattern matching in the future. The previous implementation used the same name to mean something else: Not the arity of the case class itself but the arity of the pattern/type it represented. Renaming to prodArity avoids the confusion.
* Fixes problem exhibited by ensuring.scalaMartin Odersky2014-11-132-3/+12
| | | | | Need to account for the possibility that function arguments are wrapped in braces.
* Eliminate global state in LambdaLiftMartin Odersky2014-11-121-314/+311
| | | | | State moved into local transforms which are allocated one per unit. Thsi allows lambda lifters on different units to run in parallel.
* Make CapturedVars a functional transform.Martin Odersky2014-11-121-69/+72
| | | | No global side effect on capturedVars anymore.
* Remove init method from TreeTransformMartin Odersky2014-11-121-6/+1
| | | | Do not lead to temptation...
* Make CaptguredVars use prepareForUnit instead of init.Martin Odersky2014-11-121-10/+15
| | | | | | | | Required some refactoring. Instead of transformSym we now transform ValDefs as we prepare for them. The previous scheme could not control directly whetrher transformSym or collectCaptured would run first. Turns out that init ran before collectCaptured but prepareForUnit did not, leading to test failures in pos/capturedvars.
* Replaced overridden init methods with prepareForUnit.Martin Odersky2014-11-124-10/+19
| | | | | | | This allows to move to a functional implementation later. Only exception: CapturedVars still uses init() because it contains a (dubious!) interaction with intialization and transformSym. Looking at this next.
* Added methods to prepare-for and transform a complete compilation unit tree.Martin Odersky2014-11-121-4/+23
| | | | Should replace destructive inits.
* Merge pull request #220 from dotty-staging/refactor/DefTreesDmitry Petrashko2014-11-1129-541/+418
|\ | | | | Refactor/def trees
| * Factored out Positioned into separate file.Martin Odersky2014-11-114-131/+136
| |
| * Make withMods produce Untyped treesMartin Odersky2014-11-101-7/+4
| | | | | | | | | | withMods should never be used to produce a typed tree, because typed member defs get their modifiers from their symbols.
| * Drop modifiers as separate data from MemberDef treesMartin Odersky2014-11-1026-409/+284
| | | | | | | | Typed MemberDef trees now take the modifiers from their symbol's data.
| * Align phase name of FirstTransform with class nameMartin Odersky2014-11-101-1/+1
| |
* | Merge pull request #192 from smarter/fix/ThisType-subtypingodersky2014-11-111-1/+1
|\ \ | | | | | | Fix subtyping checks involving ThisType and PolyParam
| * | Fix subtyping checks involving ThisType and PolyParamGuillaume Martres2014-11-111-1/+1
| |/
* / Scopes: make sure every bucket of the hash table is usedGuillaume Martres2014-11-111-2/+4
|/ | | | | Previously, one bucket was never used because in binary, 12*2^n - 1 = 101111...
* Clean up code relating to interfaces.Martin Odersky2014-11-1010-26/+43
| | | | | | | | | | Previous implementation was confused about the meaning of interface (with default methods or without?). Now instead of Interface/JavaInterface we have PureInterface - all members are abstract methods NoInits - all members are methods
* Remove unused classMartin Odersky2014-11-101-65/+0
| | | | It functionality is now all implemented in ExplicitOuter.
* Merge pull request #217 from dotty-staging/transform/mixinDmitry Petrashko2014-11-1029-142/+677
|\ | | | | Transform/mixin
| * Generalize symbolic refsMartin Odersky2014-11-102-8/+7
| | | | | | | | | | | | | | Previously, there was a switch in SymDenotation#termRef to create a WithFixedSym ref when after erasure. This was done to fix a broken test, but it's clearly incomplete. The scheme is now replaced by one which always creates WithFixedSym Termrefs after erasure.
| * More docs and removing print statementsMartin Odersky2014-11-096-10/+24
| |
| * Merge mixin with the group of miniphases following it.Martin Odersky2014-11-091-2/+2
| |
| * Merge memoize with miniphases following it into one group.Martin Odersky2014-11-093-19/+30
| |
| * New functionality: changeOwnerAfterMartin Odersky2014-11-091-1/+23
| | | | | | | | | | | | Changes owners after a phase without copying the tree. This should be more suitable for the changeOwner operations used in the tree transforms so far, which are linear, i.e. no tree duplication is needed.
| * Fixed bug in treating Thickets in TreeTransformMartin Odersky2014-11-091-2/+3
| |
| * Better error message for adaptations of implicit methodsMartin Odersky2014-11-091-0/+2
| | | | | | | | | | | | Ig an implicit method has a result type which does not match the expected type, the new case fires. We avoid to diagnose missing arguments, because that's really confusing for an implicit method.
| * Fixed handling of ThisTypes in TypeErasure.Martin Odersky2014-11-091-1/+3
| | | | | | | | Need to be treated like TermRefs.
| * Retract of optimization in computeDenotMartin Odersky2014-11-092-3/+11
| | | | | | | | Needs a weakening of an assertion in assertErased
| * New Mixin scheme.Martin Odersky2014-11-096-169/+363
| | | | | | | | | | | | | | Split into two phases, ResolveSuper before Erasure and Mixin after. Likewise GettersSetters is split into Getters and Memoize. All tests pass, except two tests fail when compiled twice. Will investigate next why.
| * More robost handling of isSetter/isGetterMartin Odersky2014-11-091-4/+9
| | | | | | | | | | Now survives the case where a field is written x_=, dissumulating a setter.
| * Small polishings in docs and code.Martin Odersky2014-11-092-2/+2
| |
| * Accessor methods print as "method", not "val/var".Martin Odersky2014-11-092-2/+2
| |
| * More systematic handling of Scala2LocalSuffix.Martin Odersky2014-11-091-2/+2
| | | | | | | | Separate test instead of inline.
| * Fixes to Unit handling in erasureMartin Odersky2014-11-092-5/+23
| | | | | | | | | | | | 1. Erase unit results in getters to BoxedUnit. 2. Erase => Unit to ()Unit; was ()BoxedUnit 3. Make sure ValDefs have same type in tpt as in symbol, analogous to DefDefs.
| * Methods always shwoDcl as `def`Martin Odersky2014-11-091-1/+1
| | | | | | | | | | This is reasonable because getters are only generated late in the compilation pipeline. No need to hide a getter as a val in error messages.
| * Cleanup of code for ExplicitOuterMartin Odersky2014-11-091-2/+2
| |
| * Superaccessors are methodsMartin Odersky2014-11-091-1/+1
| | | | | | | | Need to have Method flag set
| * Select operations in erasure should fix symbols in types.Martin Odersky2014-11-091-1/+1
| | | | | | | | | | | | | | | | Otherwise we get binding races, e.g. for pos/t2133.scala after mixin because we create same-named symbols in subclasses, and type refs now can refer to the subclass symbol where previously they refereed to the superclass symbol. To avoid a data race the new term ref will have a fixed symbol.
| * Fix of computeDenot.Martin Odersky2014-11-091-4/+10
| | | | | | | | | | Since we demand that after erasure all TermRefs are SymDenotations we need to assure this when computing the denotations of term refs in new phases.
| * Fixed typing of supertypes.Martin Odersky2014-11-091-1/+2
| | | | | | | | Previous version could fail where the thisType widened to an explicit self type.
| * Fixed redundancy in membersNeedAsSeenFromMartin Odersky2014-11-091-1/+1
| | | | | | | | Array types are no longer used after erasure, so the test was redundant.
| * Take supercalls into account for statement contextMartin Odersky2014-11-094-10/+12
| | | | | | | | | | After Mixin, super calls can appear in statemenr sequences. They need to be typechecked and transformed using a special context.
| * Adaptation of explicitOuter to trait initializersMartin Odersky2014-11-091-3/+7
| | | | | | | | | | | | | | | | Trait initializers do not have outer params; need to avoid passing outer args to them. This problem did not manifest itself before because no trait constructor calls were generated before erasure.
| * Adaptation of Constructors to new mixin scheme.Martin Odersky2014-11-091-6/+2
| | | | | | | | No more trait_setters are called.
| * Fix problem in changeOwnerMartin Odersky2014-11-091-1/+2
| | | | | | | | | | The problem manifests itself when changing the owner of a class field. Being a ValDef, this is classified as a weak owner. But it's parent (the class) should not be owner-changed.