From c5d9b7e6a99f253d6da941610c58d9d9e1a02925 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Thu, 28 Apr 2011 16:26:05 +0000 Subject: 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. --- src/scalacheck/org/scalacheck/Prop.scala | 2 +- src/scalacheck/org/scalacheck/Properties.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/scalacheck/org') diff --git a/src/scalacheck/org/scalacheck/Prop.scala b/src/scalacheck/org/scalacheck/Prop.scala index 68e4b89660..199a668914 100644 --- a/src/scalacheck/org/scalacheck/Prop.scala +++ b/src/scalacheck/org/scalacheck/Prop.scala @@ -39,7 +39,7 @@ trait Prop { /** Convenience method that checks this property and reports the * result on the console. If you need to get the results from the test use * the check methods in Test instead. */ - def check: Unit = check(Test.Params()) + def check(): Unit = check(Test.Params()) /** Convenience method that makes it possible to use a this property * as an application that checks itself on execution */ diff --git a/src/scalacheck/org/scalacheck/Properties.scala b/src/scalacheck/org/scalacheck/Properties.scala index bb2fe77c47..7fceb4bd35 100644 --- a/src/scalacheck/org/scalacheck/Properties.scala +++ b/src/scalacheck/org/scalacheck/Properties.scala @@ -51,7 +51,7 @@ class Properties(val name: String) extends Prop { /** Convenience method that checks the properties and reports the * result on the console. If you need to get the results from the test use * the check methods in Test instead. */ - override def check: Unit = check(Test.Params()) + override def check(): Unit = check(Test.Params()) /** Convenience method that makes it possible to use a this instance * as an application that checks itself on execution */ -- cgit v1.2.3