summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-10-11 04:14:27 +0000
committerPaul Phillips <paulp@improving.org>2010-10-11 04:14:27 +0000
commit487e5bf895cde949c6c057e029c0bf96c6232431 (patch)
tree0def5bf0234124474e4d9bf6d6905f4edba35496 /src
parent40cd42b7f53965424fd3c7cc655466e1c0861784 (diff)
downloadscala-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')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala10
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