diff options
author | Paul Phillips <paulp@improving.org> | 2011-04-28 16:26:05 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-04-28 16:26:05 +0000 |
commit | c5d9b7e6a99f253d6da941610c58d9d9e1a02925 (patch) | |
tree | 461c02007998ff775201b6860843b555f4ae3bfc /test/files/neg/accesses.check | |
parent | 199ec3c10fe7d2b2029ea8ae6a19240b46181435 (diff) | |
download | scala-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 'test/files/neg/accesses.check')
-rw-r--r-- | test/files/neg/accesses.check | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/files/neg/accesses.check b/test/files/neg/accesses.check index 94fcd615bc..db58af12ce 100644 --- a/test/files/neg/accesses.check +++ b/test/files/neg/accesses.check @@ -1,17 +1,17 @@ -accesses.scala:23: error: overriding method f2 in class A of type => Unit; +accesses.scala:23: error: overriding method f2 in class A of type ()Unit; method f2 has weaker access privileges; it should not be private - private def f2: Unit = () + private def f2(): Unit = () ^ -accesses.scala:24: error: overriding method f3 in class A of type => Unit; +accesses.scala:24: error: overriding method f3 in class A of type ()Unit; method f3 has weaker access privileges; it should be at least protected - private[p2] def f3: Unit = () + private[p2] def f3(): Unit = () ^ -accesses.scala:25: error: overriding method f4 in class A of type => Unit; +accesses.scala:25: error: overriding method f4 in class A of type ()Unit; method f4 has weaker access privileges; it should be at least private[p1] - private[p2] def f4: Unit + private[p2] def f4(): Unit ^ -accesses.scala:26: error: overriding method f5 in class A of type => Unit; +accesses.scala:26: error: overriding method f5 in class A of type ()Unit; method f5 has weaker access privileges; it should be at least protected[p1] - protected[p2] def f5: Unit + protected[p2] def f5(): Unit ^ four errors found |