summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-06-10 22:38:17 +0000
committerPaul Phillips <paulp@improving.org>2011-06-10 22:38:17 +0000
commitc8f4316b374d78caaf5ba605cd34e323b78a77de (patch)
treeef5a8e696e7ba9b7e3578ae6be3d9c5845e4372a /src
parent21e90dfb5958bd5a8030a6edf16b38518e2d69e5 (diff)
downloadscala-c8f4316b374d78caaf5ba605cd34e323b78a77de.tar.gz
scala-c8f4316b374d78caaf5ba605cd34e323b78a77de.tar.bz2
scala-c8f4316b374d78caaf5ba605cd34e323b78a77de.zip
A test case demonstrating some of the issues wi...
A test case demonstrating some of the issues with DelayedInit. References #4680. Review by odersky.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/transform/Constructors.scala7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/Constructors.scala b/src/compiler/scala/tools/nsc/transform/Constructors.scala
index c1efe4843d..6ea6f9c4d6 100644
--- a/src/compiler/scala/tools/nsc/transform/Constructors.scala
+++ b/src/compiler/scala/tools/nsc/transform/Constructors.scala
@@ -556,6 +556,13 @@ abstract class Constructors extends Transform with ast.TreeDSL {
var (uptoSuperStats, remainingConstrStats) = splitAtSuper(constrStatBuf.toList)
+ /** XXX This is not corect: remainingConstrStats.nonEmpty excludes too much,
+ * but excluding it includes too much. The constructor sequence being mimicked
+ * needs to be reproduced with total fidelity.
+ *
+ * See test case files/run/bug4680.scala, the output of which is wrong in many
+ * particulars.
+ */
val needsDelayedInit =
(clazz isSubClass DelayedInitClass) /*&& !(defBuf exists isInitDef)*/ && remainingConstrStats.nonEmpty