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

Some Dotty compat for tests #3253

Merged
merged 4 commits into from
Jan 13, 2020

Conversation

travisbrown
Copy link
Contributor

Dotty doesn't like local implicit vals without type annotations. I'm finally getting back to Dotty cross-building for tests after doing this for core and laws a few weeks back. In my view these changes are an improvement even on Scala 2.

The only non-trivial change is in RepresentableSuite, where there was some kind of weird code like this:

implicit val bimonadInstance = Representable.bimonad[Pair, Boolean]

The issue here is that Representable.bimonad has a Representable[Pair] constraint, and the Representable[Pair] instance has a Functor[Pair] constraint. But bimonadInstance is a Functor[Pair]. If you leave off the type annotation Scala is fine with this (because Scala), but if you put it on you get forward reference errors from the compiler. I've worked around this by invoking the Representable[X] in an outer scope and assigning it to a non-implicit val.

I've also removed the single bracket in SemigroupKSuite because some other weird stuff was happening that seems entirely unrelated to what's being tested there.

LukaJCB
LukaJCB previously approved these changes Jan 13, 2020
Copy link
Member

@rossabaker rossabaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 on green

@codecov-io
Copy link

codecov-io commented Jan 13, 2020

Codecov Report

Merging #3253 into master will increase coverage by 0.22%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3253      +/-   ##
==========================================
+ Coverage   92.83%   93.05%   +0.22%     
==========================================
  Files         375      376       +1     
  Lines        7392     7415      +23     
  Branches      202      202              
==========================================
+ Hits         6862     6900      +38     
+ Misses        530      515      -15
Flag Coverage Δ
#scala_version_212 93.38% <100%> (?)
#scala_version_213 92.83% <100%> (ø) ⬆️
Impacted Files Coverage Δ
...estkit/src/main/scala/cats/tests/ListWrapper.scala 100% <ø> (ø) ⬆️
...c/main/scala/cats/laws/UnorderedTraverseLaws.scala 78.94% <100%> (ø) ⬆️
laws/src/main/scala/cats/laws/TraverseLaws.scala 92.3% <100%> (ø) ⬆️
...rc/main/scala/cats/laws/NonEmptyTraverseLaws.scala 85% <100%> (ø) ⬆️
core/src/main/scala/cats/Show.scala 100% <0%> (ø) ⬆️
core/src/main/scala/cats/instances/tuple.scala 100% <0%> (ø) ⬆️
core/src/main/scala/cats/data/Const.scala 100% <0%> (ø) ⬆️
core/src/main/scala/cats/data/Validated.scala 100% <0%> (ø) ⬆️
...cala-2.12/cats/kernel/compat/TraversableOnce.scala 0% <0%> (ø)
core/src/main/scala/cats/data/NonEmptyVector.scala 99.15% <0%> (+0.01%) ⬆️
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0c8ca51...06608e9. Read the comment docs.

@travisbrown travisbrown merged commit 8d4ee36 into typelevel:master Jan 13, 2020
@travisbrown travisbrown added this to the 2.2.0-M1 milestone Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants