Skip to content

Commit e26d9be

Browse files
authored
Merge pull request #925 from akonior/bugfix/userguide-examples-scala3
fix scala 3 compilation errors in user guide examples
2 parents 31f911a + e04b5b2 commit e26d9be

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

doc/UserGuide.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Here are some examples of properties defined with help of the
8686
```scala
8787
import org.scalacheck.Prop.forAll
8888

89-
val propReverseList = forAll { l: List[String] => l.reverse.reverse == l }
89+
val propReverseList = forAll { (l: List[String]) => l.reverse.reverse == l }
9090

9191
val propConcatString = forAll { (s1: String, s2: String) =>
9292
(s1 + s2).endsWith(s2)
@@ -124,7 +124,7 @@ you can use the implication operator `==>`:
124124
```scala
125125
import org.scalacheck.Prop.{forAll, propBoolean}
126126

127-
val propMakeList = forAll { n: Int =>
127+
val propMakeList = forAll { (n: Int) =>
128128
(n >= 0 && n < 10000) ==> (List.fill(n)("").length == n)
129129
}
130130
```
@@ -140,7 +140,7 @@ non-zero will be thrown away:
140140
```
141141
scala> import org.scalacheck.Prop.{forAll, propBoolean}
142142
143-
scala> val propTrivial = forAll { n: Int =>
143+
scala> val propTrivial = forAll { (n: Int) =>
144144
| (n == 0) ==> (n == 0)
145145
| }
146146
@@ -628,7 +628,7 @@ list.
628628
```scala
629629
import org.scalacheck.Prop._
630630

631-
val myProp = forAll { l: List[Int] =>
631+
val myProp = forAll { (l: List[Int]) =>
632632
classify(ordered(l), "ordered") {
633633
classify(l.length > 5, "large", "small") {
634634
l.reverse.reverse == l

0 commit comments

Comments
 (0)