summaryrefslogtreecommitdiff
path: root/src/library/scala/collection/mutable/ObservableBuffer.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-04-28 16:26:05 +0000
committerPaul Phillips <paulp@improving.org>2011-04-28 16:26:05 +0000
commitc5d9b7e6a99f253d6da941610c58d9d9e1a02925 (patch)
tree461c02007998ff775201b6860843b555f4ae3bfc /src/library/scala/collection/mutable/ObservableBuffer.scala
parent199ec3c10fe7d2b2029ea8ae6a19240b46181435 (diff)
downloadscala-c5d9b7e6a99f253d6da941610c58d9d9e1a02925.tar.gz
scala-c5d9b7e6a99f253d6da941610c58d9d9e1a02925.tar.bz2
scala-c5d9b7e6a99f253d6da941610c58d9d9e1a02925.zip
I wrote a warning when nullary methods return U...
I wrote a warning when nullary methods return Unit. I wimped out of including it in this patch because we had about 200 of them, and that's what is fixed in this patch. I will add the warning to some kind of "-Xlint" feature after 2.9. This is motivated at least partly by the resolution of #4506, which indicates the distinction between "def foo()" and "def foo" will continue to jab its pointy stick into our eyes, so I believe we have a minimal duty of at least following our own advice about what they mean and not making a semirandom choice as to whether a method has parens or not. Review by community.
Diffstat (limited to 'src/library/scala/collection/mutable/ObservableBuffer.scala')
-rw-r--r--src/library/scala/collection/mutable/ObservableBuffer.scala6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/library/scala/collection/mutable/ObservableBuffer.scala b/src/library/scala/collection/mutable/ObservableBuffer.scala
index aa9bd7ac95..c38bf5fbf3 100644
--- a/src/library/scala/collection/mutable/ObservableBuffer.scala
+++ b/src/library/scala/collection/mutable/ObservableBuffer.scala
@@ -46,7 +46,7 @@ trait ObservableBuffer[A] extends Buffer[A] with Publisher[Message[A] with Undoa
val oldelement = apply(n)
super.update(n, newelement)
publish(new Update(Index(n), newelement) with Undoable {
- def undo { update(n, oldelement) }
+ def undo() { update(n, oldelement) }
})
}
@@ -54,7 +54,7 @@ trait ObservableBuffer[A] extends Buffer[A] with Publisher[Message[A] with Undoa
val oldelement = apply(n)
super.remove(n)
publish(new Remove(Index(n), oldelement) with Undoable {
- def undo { insert(n, oldelement) }
+ def undo() { insert(n, oldelement) }
})
oldelement
}
@@ -62,7 +62,7 @@ trait ObservableBuffer[A] extends Buffer[A] with Publisher[Message[A] with Undoa
abstract override def clear(): Unit = {
super.clear
publish(new Reset with Undoable {
- def undo { throw new UnsupportedOperationException("cannot undo") }
+ def undo() { throw new UnsupportedOperationException("cannot undo") }
})
}
}