summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2008-09-05 14:34:25 +0000
committerMartin Odersky <odersky@gmail.com>2008-09-05 14:34:25 +0000
commit5d0ff3c25ee91272fb945c17d182cf4145917d6b (patch)
treec2df58495a7baebf7f3893e1f878fe1eab364bda /src
parentfa8d0d8d853cebdfa33552ca2f66c229b6d39f2d (diff)
downloadscala-5d0ff3c25ee91272fb945c17d182cf4145917d6b.tar.gz
scala-5d0ff3c25ee91272fb945c17d182cf4145917d6b.tar.bz2
scala-5d0ff3c25ee91272fb945c17d182cf4145917d6b.zip
refined volatile checking
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Types.scala10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala
index aaa24b7d19..4da4b5f09b 100644
--- a/src/compiler/scala/tools/nsc/symtab/Types.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Types.scala
@@ -1166,8 +1166,9 @@ trait Types {
else super.normalize
/** A refined type P1 with ... with Pn { decls } is volatile if
- * one of the parent types Pi is an abstract type, and either decls
- * or a following parent Pj, j > i, contributes an abstract member.
+ * one of the parent types Pi is an abstract type, and
+ * either i > 1, or decls or a following parent Pj, j > 1, contributes
+ * an abstract member.
* A type contributes an abstract member if it has an abstract member which
* is also a member of the whole refined type. A scope `decls' contributes
* an abstract member if it has an abstract definition which is also
@@ -1180,8 +1181,9 @@ trait Types {
p.deferredMembers exists isVisible
parents dropWhile (! _.typeSymbol.isAbstractType) match {
- case _ :: ps =>
- (ps exists contributesAbstractMembers) ||
+ case ps @ (_ :: ps1) =>
+ (ps ne parents) ||
+ (ps1 exists contributesAbstractMembers) ||
(decls.elements exists (m => m.isDeferred && isVisible(m)))
case _ =>
false