Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking change: NestedSyntax collides with Optionable in Scalatest causing codebases to no longer compile tests. #2613

Closed
coltfred opened this issue Nov 15, 2018 · 3 comments
Labels

Comments

@coltfred
Copy link
Contributor

If you upgrade from cats 1.1.0 to 1.2+ and you use OptionValues from Scalatest you'll end up with errors like the following.

src/test/scala/com/ironcorelabs/admin/CookiesTest.scala:39: type mismatch;
 found   : gottenCookie.type (with underlying type Option[scodec.bits.ByteVector])
 required: ?{def value: ?}
Note that implicit conversions are not applicable because they are ambiguous:
 both method catsSyntaxNestedId in trait NestedSyntax of type [F[_], G[_], A](value: F[G[A]])cats.syntax.NestedIdOps[F,G,A]
 and method convertOptionToValuable in trait OptionValues of type [T](opt: Option[T])(implicit pos: org.scalactic.source.Position)CookiesTest.this.Valuable[T]
 are possible conversion functions from gottenCookie.type to ?{def value: ?}
      gottenCookie.value shouldBe Password(hexBytes.value)

This is caused by the fact that .value is syntax added to the Option type as well as the NestedSyntax conversion are at the same implicit level. I hadn't upgraded my cats version in a while so I didn't notice this until now, but it's a huge PITA. It means people might end up with cats all of a sudden not working for their project.

@kailuowang
Copy link
Contributor

related issue #2514

@coltfred
Copy link
Contributor Author

@kailuowang Should we close these on merge or when the release happens?

@kailuowang
Copy link
Contributor

yeah we can close this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants