diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 647e5e422d..3f4ff066d2 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -1632,11 +1632,11 @@ trait Typers { self: Analyzer => // an object cannot be allowed to pass a reference to itself to a superconstructor // because of initialization issues; bug #473 - for { - arg <- superArgs - val sym = arg.symbol - if sym != null && sym.isModule && (sym.info.baseClasses contains clazz) - } error(rhs.pos, "super constructor cannot be passed a self reference unless parameter is declared by-name") + for (arg <- superArgs ; tree <- arg) { + val sym = tree.symbol + if (sym != null && sym.isModule && (sym.info.baseClasses contains clazz)) + error(rhs.pos, "super constructor cannot be passed a self reference unless parameter is declared by-name") + } if (superConstr.symbol.isPrimaryConstructor) { val superClazz = superConstr.symbol.owner |