diff options
author | Martin Odersky <odersky@gmail.com> | 2014-07-03 18:57:22 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-07-17 11:01:59 +0200 |
commit | efe4f7e43652a303d16a5253f84316e547f45cca (patch) | |
tree | 1ea59d27843909b7633e0851e6c8b2cdd32e38c6 /test | |
parent | a47b8b4d3c22133e8cde0053701057e56cc71acb (diff) | |
download | dotty-efe4f7e43652a303d16a5253f84316e547f45cca.tar.gz dotty-efe4f7e43652a303d16a5253f84316e547f45cca.tar.bz2 dotty-efe4f7e43652a303d16a5253f84316e547f45cca.zip |
Changed PostTyperTransformer scheme
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.
Diffstat (limited to 'test')
-rw-r--r-- | test/test/transform/CreateCompanionObjectsTest.scala | 6 | ||||
-rw-r--r-- | test/test/transform/LazyValsTest.scala | 4 | ||||
-rw-r--r-- | test/test/transform/PostTyperTransformerTest.scala | 4 |
3 files changed, 8 insertions, 6 deletions
diff --git a/test/test/transform/CreateCompanionObjectsTest.scala b/test/test/transform/CreateCompanionObjectsTest.scala index 05f4e1062..82830781c 100644 --- a/test/test/transform/CreateCompanionObjectsTest.scala +++ b/test/test/transform/CreateCompanionObjectsTest.scala @@ -14,14 +14,15 @@ import Types._ import Decorators._ import Trees._ import dotty.tools.dotc.transform.TreeTransforms.{TreeTransform, TreeTransformer} -import dotty.tools.dotc.transform.PostTyperTransformers.PostTyperTransformer -import dotty.tools.dotc.transform.CreateCompanionObjects class CreateCompanionObjectsTest extends DottyTest { + /* FIXME: re-enable after adapting to new scheme import tpd._ + type PostTyperTransformer = TreeTransformer // FIXME do without + @Test def shouldCreateNonExistingObjectsInPackage = checkCompile("frontend", "class A{} ") { (tree, context) => @@ -123,4 +124,5 @@ class CreateCompanionObjectsTest extends DottyTest { classPos < modulePos && (notCreatedPos < 0) ) } + */ } diff --git a/test/test/transform/LazyValsTest.scala b/test/test/transform/LazyValsTest.scala index aee6cbb9c..5b8a659fa 100644 --- a/test/test/transform/LazyValsTest.scala +++ b/test/test/transform/LazyValsTest.scala @@ -5,7 +5,7 @@ import test.DottyTest import org.junit.Assert class LazyValsTest extends DottyTest { - + /* FIXME: re-enable after adapting to new scheme @Test def doNotRewriteObjects = { checkCompile("LazyVals", "object O"){ (tree, ctx) => @@ -356,5 +356,5 @@ class LazyValsTest extends DottyTest { Assert.assertTrue("volatile field lazy ref rewritten to class creation", treeS.contains(moduleField) && treeS.contains(reuseFieldPattern)) } - } + }*/ } diff --git a/test/test/transform/PostTyperTransformerTest.scala b/test/test/transform/PostTyperTransformerTest.scala index 0c3f222c7..9886c3023 100644 --- a/test/test/transform/PostTyperTransformerTest.scala +++ b/test/test/transform/PostTyperTransformerTest.scala @@ -14,9 +14,9 @@ import Types._ import Decorators._ import Trees._ import dotty.tools.dotc.transform.TreeTransforms.{TreeTransform, TreeTransformer} -import dotty.tools.dotc.transform.PostTyperTransformers.PostTyperTransformer class PostTyperTransformerTest extends DottyTest { + /* FIXME: re-enable after adapting to new scheme @Test def shouldStripImports = checkCompile("frontend", "class A{ import scala.collection.mutable._; val d = 1}") { @@ -128,5 +128,5 @@ class PostTyperTransformerTest extends DottyTest { Assert.assertTrue("should reorder existing objects in template", classPos < modulePos ) - } + }*/ } |