aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Enable tests that succeed.Dmitry Petrashko2015-06-1578-0/+0
|
* Mixin: implementations of Scala2 LazyVals need a rhs.Dmitry Petrashko2015-06-151-1/+7
| | | | | Unlike normal fields, they aren't initialised in $init method, and need to know a bit about class layout of implementation class. Luckily AugmentScala2Traits added just enough symbols to make this work.
* Annotate lazy vals in Scala2 traits with @volatileMartin Odersky2015-06-081-3/+9
| | | | Scala-2 lazy vals are @volatile according to Dotty conventions.
* New SymDenotation method: expandedName.Martin Odersky2015-06-081-5/+8
|
* Copy @field annotations from getters to fields.Martin Odersky2015-06-082-1/+13
| | | | For the moment, we keep all annotations on getters and setters, but this could be changed.
* Methods for filtering annotations carrying meta information.Martin Odersky2015-06-084-5/+18
|
* Copy annotations from trait members to their implementationsMartin Odersky2015-06-082-3/+12
| | | | Implementations inherit all annotations on the implemented trait methods.
* Fix to trait setter generationMartin Odersky2015-06-082-10/+7
| | | | | The logic to add trait setters to Scala 2 traits was wrong. This led to AbstractMethodErrors in the formerly commented out part of scala-trait.scala.
* Merge pull request #622 from dotty-staging/add/implement-scala2-traitsodersky2015-06-0627-118/+376
|\ | | | | Implement Scala2 traits
| * Fixed test.Martin Odersky2015-06-021-2/+8
| | | | | | | | | | | | | | | | | | Until the previous fix to Denotation-& the test here spuriously passed. The Dotty spec is that value classes synthesize equals and hashCode only if no concrete definitions are inherited except the ones from Any. That was previously miscalculated. The test has been updated to reflect the specified behavior.
| * Make LazyVals respect scope hygiene.Martin Odersky2015-06-021-3/+3
| | | | | | | | | | | | | | | | | | | | The previius commit on "Refine & for Denotations" caused NotDefinedHere errors in the backend when compiling dotc/typer. These were tracked down to three occurrences in LazyVals where `enter` instead of `enteredAfter` was used. `enter` will enter a symbol in an unknown set of previous phases. Transformations that traverse scope (like erasedMembers in TypeErasure will then see the denotations of these symbols outside the scope in which they are defined.
| * Refine "&" for denotations.Martin Odersky2015-06-021-9/+45
| | | | | | | | | | | | | | | | | | The policy is now made clear in a doc comment. The new part is that we will prefer a symbol defined in a subclass over a symbol defined in a superclass. With the previous commit 0a0d3dd1 on "More precise and uniform modelling of isCurrent" we got runtime test failures for Course-2002-03.scala because the new definition isCurrent assumed a behavior of `member` which was not assured: Namely that the merged denotation would prefer symbols in subclasses over symbols in superclasses.
| * More precise and uniform modelling of "isCurrent"Martin Odersky2015-06-012-8/+5
| | | | | | | | | | | | | | | | For implemented getters and forwarded methods we need a notion of "isCurrent", which means: would the getter or method before the implementation is added be a member of the implementing class? Only in this case do we need to do anything. The method formulation was previously weaker than the getter formulation, which led to an error when compiling core (duplicate methods: andThen and size).
| * Add test case.Martin Odersky2015-06-012-0/+58
| | | | | | | | We are still lacking the setup to do this right for mixed Scala 2/Dotty runtime tests. So I checked into `pos` for now.
| * Avoid generating trait setters for constants.Martin Odersky2015-06-011-1/+2
| | | | | | | | Scalac does not generate them either.
| * Uncomment important test for Scala trait forwardingMartin Odersky2015-06-011-1/+1
| | | | | | | | Scala 2 doe snot generate default methods, so we always need forwarders.
| * Fix missing implementation class forwardMartin Odersky2015-06-011-9/+1
| | | | | | | | | | A transformFollowingDeep was missing, so LinkScala2ImplClasses never got to see the call.
| * Elim ElimWildcardIdentsMartin Odersky2015-06-016-46/+12
| | | | | | | | | | | | Instead of cleaning up, generate sensical code in the first place. This is shorter and (I would argue) clearer, and also has the advantage that some initializing assignments are not generated at all.
| * Make elimWildcardIdents apply to AssignmentsMartin Odersky2015-06-012-1/+4
| | | | | | | | | | | | | | | | Fixes junit failure in dotty where a lazy val was initialized with a "...$lazy = _" assignment. Moved ElimWiildcard to one group before. It does not really matter where it goes so it might as well go someshere in the middle of the pack.
| * Improve commentsMartin Odersky2015-06-012-2/+14
| |
| * New phase: LinkScala2ImplClassesMartin Odersky2015-06-012-1/+59
| | | | | | | | This phase rewrites supercalls to calls to static implementation class methods.
| * Make memberSignature work after erasure.Martin Odersky2015-06-011-3/+9
| | | | | | | | Erasure uncurries arguments, need to track that in memberSignature.
| * New phase: AugmentScala2TraitsMartin Odersky2015-06-014-4/+103
| |
| * Avoid referring to initial$x methods when implementing Scala2 traitsMartin Odersky2015-06-011-6/+11
| | | | | | | | | | They don't exist for Scala2 traits. Instead we let the initializer be `_' and rely on trait setters (to be implemented) to initialize the field.
| * New utility method tpd.UnderscoreMartin Odersky2015-06-015-5/+7
| | | | | | | | A typed `_'. This is needed in a few places.
| * Make ensureMethodic work after erasure.Martin Odersky2015-06-012-2/+2
| | | | | | | | | | Previously it didn't, because it created an ExprType, which is illegal after erasure.
| * Use $init$ as the name of trait constructorsMartin Odersky2015-06-011-1/+1
| | | | | | | | This brings it in line with Scala2 conventions.
| * Move needsForwarder logic from ResolveSuper to MixinOps.Martin Odersky2015-06-012-8/+13
| | | | | | | | We'd like to make it reusable for a phase that treats Scala2 traits.
| * New NameOps methods for Scala2 traitsMartin Odersky2015-06-013-4/+12
| | | | | | | | Also: generalize expandedName so that it can cater for trait setters.
| * Make Mutable a ModifierFlag.Martin Odersky2015-06-012-2/+8
| | | | | | | | | | | | It definitely does appear in trees, so should be included in the set. Affects how things are printed. Before, typed var's would still show up as vals.
| * Merge postConditions of memoize and constructorsMartin Odersky2015-06-012-11/+9
| | | | | | | | | | | | | | If memoize and constructors are run in different groups, memoize's previous postcondition "all concerete methods are implemented" is wrong, because constructors are not implemengted yet. Solved by moving the postcondition to phase Constructors.
* | Merge pull request #628 from dotty-staging/fix/initializer-deadlocksDmitry Petrashko2015-06-0314-74/+77
|\ \ | |/ |/| Fix/initializer deadlocks
| * Test case for problems with lambda lifting.Martin Odersky2015-06-031-0/+9
| |
| * Compute outer.path in lambdaLift at correct phase.Martin Odersky2015-06-033-4/+8
| | | | | | | | | | | | | | | | | | | | LambdaLift needs to compute outer.path at the phase in which the results are constructed, i.e. phase lambdaLift.next. Or else we get an error in outer.path for lost fo files, including pos/Fileish.scala as a minimized test case. Previously outer as computed at phase lambdaLift. The reason for this is that lambdaLift name mangles inner classes, which causes outer acessors to be not found. We now correct for the problem in outer.path itself, by calling outerAccessor only at a safe phase.
| * Narrow liftedOwner also for static objectsMartin Odersky2015-06-031-4/+3
| | | | | | | | | | Lambdas should stay inside static objects if they reference to them with a This or Ident. Fixes test case `llist.scala` but demonstrates another problem.
| * Move test from lambdaLift.scala to a separate file in pending.Dmitry Petrashko2015-06-022-21/+20
| |
| * Revert "Fix ElimStaticThis#transformIdent"Dmitry Petrashko2015-06-022-9/+4
| | | | | | | | | | | | | | | | | | | | | | This reverts commit 3d240ad40ccfb570174ec9758bfe68ba4e91eefb. This commit got in without succeding the review. It broke what already was working(inner static objects), and made impossible moving static methods from companion object to companion class. Additionally, commenting or removing assertions is not the way to go, and should not pass review. See discussion here: https://github.com/dotty-staging/dotty/commit/3d240ad40ccfb570174ec9758bfe68ba4e91eefb
| * Revert "Update t6260-delambdafy.check to account for change in lambda ↵Dmitry Petrashko2015-06-021-0/+1
| | | | | | | | | | | | | | | | generation" This reverts commit cafd71af4902c76561f27a479c14e53729600bb9. For the future refference: tests and checkfiles should be modified only after carefull thought. Otherwise our tests will stop indicating the correct behaviour.
| * Avoid static initialization deadlock in run tests (2).Martin Odersky2015-06-011-2/+9
| | | | | | | | | | | | | | | | See https://github.com/lampepfl/dotty/pull/624#issuecomment-107064519 for a lengthy explanation. We now solve the problem in LambdaLift. The formerly failing tests are all reverted to theor original, failing, version.
| * Revert "Avoid static initialization deadlock in run tests."Martin Odersky2015-06-015-34/+23
|/ | | | This reverts commit 8f90105dc4e62e78d53b385df1b2eb29f2855183.
* Merge pull request #626 from smarter/fix/ast-tostringodersky2015-05-311-2/+2
|\ | | | | Add missing string interpolator prefix in some AST nodes' toString
| * Add missing string interpolator prefix in some AST nodes' toStringGuillaume Martres2015-05-311-2/+2
|/
* Merge pull request #625 from smarter/add/ast-toStringodersky2015-05-311-2/+7
|\ | | | | Trees: Add toString for AST nodes which are not case classes
| * Trees: Add toString for AST nodes which are not case classesGuillaume Martres2015-05-301-2/+7
| | | | | | | | This makes debugging trees easier.
* | Merge pull request #623 from dotty-staging/make-tests-passodersky2015-05-3118-62/+116
|\ \ | |/ |/| Make tests pass
| * Fix ElimStaticThis#transformIdentGuillaume Martres2015-05-302-4/+9
| | | | | | | | | | | | | | | | | | - Only transform static methods which are inside module classes. - Make sure that the prefix of the underlying type of the Ident is a ThisType of the current module class. For example in "scala.Int.box(42)", "box" is an Ident whose underlying type is "TermRef(ThisType(TypeRef(ThisType(TypeRef(NoPrefix,scala)),Int$)),box)", but we should not trigger an assertion in this case.
| * Update t6260-delambdafy.check to account for change in lambda generationGuillaume Martres2015-05-301-1/+0
| |
| * Avoid static initialization deadlock in run tests.Guillaume Martres2015-05-305-23/+34
| | | | | | | | | | See https://github.com/lampepfl/dotty/pull/624#issuecomment-107064519 for a lengthy explanation.
| * New phase: ElimStaticThisDmitry Petrashko2015-05-292-0/+39
| |
| * Bring back disabled test.Martin Odersky2015-05-292-0/+0
| |