summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-06-08 12:11:51 -0700
committerPaul Phillips <paulp@improving.org>2013-06-08 12:11:51 -0700
commita9972cc7e851882b5e0b4d6d97ad951b012167c0 (patch)
tree4b4eb0ebdf4b9d61ff833d26c545a631508bd871 /src
parentcb9edc9736d8fe27c8c8bf5fefbd64f163a1c596 (diff)
parent608f577e0a565c746f94b9b52ceadf9728b179b4 (diff)
downloadscala-a9972cc7e851882b5e0b4d6d97ad951b012167c0.tar.gz
scala-a9972cc7e851882b5e0b4d6d97ad951b012167c0.tar.bz2
scala-a9972cc7e851882b5e0b4d6d97ad951b012167c0.zip
Merge pull request #2611 from retronym/ticket/6481
SI-6841 Fix bug at the intersection of DelayedInit and named args
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/transform/Constructors.scala5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/Constructors.scala b/src/compiler/scala/tools/nsc/transform/Constructors.scala
index 4891ef2fd1..1a1137f402 100644
--- a/src/compiler/scala/tools/nsc/transform/Constructors.scala
+++ b/src/compiler/scala/tools/nsc/transform/Constructors.scala
@@ -523,7 +523,10 @@ abstract class Constructors extends Transform with ast.TreeDSL {
/** Return a pair consisting of (all statements up to and including superclass and trait constr calls, rest) */
def splitAtSuper(stats: List[Tree]) = {
- def isConstr(tree: Tree) = (tree.symbol ne null) && tree.symbol.isConstructor
+ def isConstr(tree: Tree): Boolean = tree match {
+ case Block(_, expr) => isConstr(expr) // SI-6481 account for named argument blocks
+ case _ => (tree.symbol ne null) && tree.symbol.isConstructor
+ }
val (pre, rest0) = stats span (!isConstr(_))
val (supercalls, rest) = rest0 span (isConstr(_))
(pre ::: supercalls, rest)