typelevel / scalacheck

Property-based testing for Scala
http://www.scalacheck.org
BSD 3-Clause "New" or "Revised" License
1.94k stars 404 forks source link

Import conflict with implication operator in Intellij #371

Closed spockoyno closed 6 years ago

spockoyno commented 6 years ago

The code val propMakeList = forAll { n: Int => (n >= 0 && n < 10000) ==> (List.fill(n)("").length == n) } works with import org.scalacheck.Prop.forAll import org.scalacheck.Prop.BooleanOperators However, a compilation error "Cannot resolve symbol" ==> appears for import 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

Ubadub commented 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.

spockoyno commented 6 years ago

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.

Ubadub commented 6 years ago

I believe it is, actually

spockoyno commented 6 years ago

Likely to be Intellij issue.