diff options
author | Paul Phillips <paulp@improving.org> | 2010-10-11 04:14:27 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-10-11 04:14:27 +0000 |
commit | 487e5bf895cde949c6c057e029c0bf96c6232431 (patch) | |
tree | 0def5bf0234124474e4d9bf6d6905f4edba35496 /src/compiler | |
parent | 40cd42b7f53965424fd3c7cc655466e1c0861784 (diff) | |
download | scala-487e5bf895cde949c6c057e029c0bf96c6232431.tar.gz scala-487e5bf895cde949c6c057e029c0bf96c6232431.tar.bz2 scala-487e5bf895cde949c6c057e029c0bf96c6232431.zip |
Better check for objects trying to sneak themse...
Better check for objects trying to sneak themselves into the
superconstructor arguments. Closes #3913, no review.
Diffstat (limited to 'src/compiler')
-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 |