Closed spockoyno closed 6 years ago
I am having the same issue. You cannot include the line
import org.scalacheck.Prop._
(or any variation therefore, i.e. import org.scalacheck._
followed by import Prop._
)
anywhere in your code if you want the ==> (implication) operator to work. I disagree with the previous poster (@spockoyno) that this is not a big deal in itself. It's highly unintuitive for people new to scalacheck for imports to behave in this fashion.
What's the reason for this, anyways? It makes very little sense.
Might it actually be an issue with the Intellij rather than with scalaceck? I've had a few "good code red" and similar problems in Intellij with "shapeless" and other scala libraries.
I believe it is, actually
Likely to be Intellij issue.
The code
val propMakeList = forAll { n: Int => (n >= 0 && n < 10000) ==> (List.fill(n)("").length == n) }
works withimport org.scalacheck.Prop.forAll import org.scalacheck.Prop.BooleanOperators
However, a compilation error "Cannot resolve symbol" ==> appears forimport org.scalacheck.Prop._ import org.scalacheck.Prop.BooleanOperators
(The latter import is now greyed, ie, unused.) The strategies in #159 didn't work. This issue is not a big deal in itself; I'm raising it just in case it might suggest something else. Thanks!Environment: Scala 2.12.4 Scalacheck 1.13.4 Intellij Ultimate 2017.2.5