diff options
author | Martin Odersky <odersky@gmail.com> | 2014-03-01 13:17:05 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-03-01 13:41:00 +0100 |
commit | d8356b6dc9221bfc38b1f167e5cfafcc9261f3d7 (patch) | |
tree | 3bb6fda0feb33680f68f61908a7076162159701e /test/dotc/tests.scala | |
parent | 5a8f4c822be82e23a0c230071673425423664442 (diff) | |
download | dotty-d8356b6dc9221bfc38b1f167e5cfafcc9261f3d7.tar.gz dotty-d8356b6dc9221bfc38b1f167e5cfafcc9261f3d7.tar.bz2 dotty-d8356b6dc9221bfc38b1f167e5cfafcc9261f3d7.zip |
Reorganization of template parents.
Template parents always were constructor calls before. This is not correct because in a situation like the one
elaborated in templateParents, the trait D has the class C as supertype, but it does not call its constructor (in fact, if we added a () parameter list to make it into a constructor this would be wrong because C takes parameters.
Now parents can be either types or constructor calls.
The logic in Namer and Typer that deals with parents is cleaned up. In particular, we now construct any synthetic class parent as a full type, before calling normalizeToClassRefs. This obviates the forwardRefs logic that needed to be done in a cleanup of Namers.
Also added two more checks: (1) All parents except the first one must point to traits. (2) A trait may not call a parent class constructor.
Diffstat (limited to 'test/dotc/tests.scala')
-rw-r--r-- | test/dotc/tests.scala | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/dotc/tests.scala b/test/dotc/tests.scala index 51982d0de..b1fb42d9e 100644 --- a/test/dotc/tests.scala +++ b/test/dotc/tests.scala @@ -38,13 +38,16 @@ class tests extends CompilerTest { @Test def pos_assignments() = compileFile(posDir, "assignments") @Test def pos_packageobject() = compileFile(posDir, "packageobject") @Test def pos_overloaded() = compileFile(posDir, "overloaded") + @Test def pos_templateParents() = compileFile(posDir, "templateParents") @Test def neg_blockescapes() = compileFile(negDir, "blockescapesNeg", xerrors = 1) @Test def neg_typedapply() = compileFile(negDir, "typedapply", xerrors = 4) @Test def neg_typedidents() = compileFile(negDir, "typedIdents", xerrors = 2) @Test def neg_assignments() = compileFile(negDir, "assignments", xerrors = 3) @Test def neg_typers() = compileFile(negDir, "typers", xerrors = 10) + @Test def neg_privates() = compileFile(negDir, "privates", xerrors = 2) @Test def neg_rootImports = compileFile(negDir, "rootImplicits", xerrors = 2) + @Test def neg_templateParents() = compileFile(posDir, "templateParents", xerrors = 2) @Test def dotc = compileDir(dotcDir + "tools/dotc") @Test def dotc_ast = compileDir(dotcDir + "tools/dotc/ast") |