GithubHelp home page GithubHelp logo

Comments (9)

joroKr21 avatar joroKr21 commented on August 17, 2024 1

Hmm, I guess that means the linter is wrong after all because the import is used.
Ok, best to report this in Dotty, I don't think we can do anything here.

from kittens.

joroKr21 avatar joroKr21 commented on August 17, 2024

I wonder if this was foreshadowed by #582
But there was no explanation really.

from kittens.

joan38 avatar joan38 commented on August 17, 2024

With kittens 3.3.0 I get some:

[error] 4 |import cats.derived.auto.semigroup.given
[error]   |                                   ^^^^^
[error]   |                                   unused import

Even on Scala 3.3.3

And if I don't given them, it fails to find the semigroups

from kittens.

joan38 avatar joan38 commented on August 17, 2024

But the following works fine lol:

import cats.derived.auto.semigroup.given_Semigroup_A

But not:

import cats.derived.auto.semigroup.given Semigroup[?]

from kittens.

joroKr21 avatar joroKr21 commented on August 17, 2024

Can you post a full example? That sounds like a bug in the linter because you are using the import.

from kittens.

joan38 avatar joan38 commented on August 17, 2024

Ah I was trying to reproduce unsuccessfully but I forgot the scalacOptions.
Here is the reproduction: https://scastie.scala-lang.org/Po0uhQLgSjyzEdnffZLi1g

from kittens.

joroKr21 avatar joroKr21 commented on August 17, 2024

I think it's kinda right because you also import monoid.given which takes priority

from kittens.

joan38 avatar joan38 commented on August 17, 2024

But having just import cats.derived.auto.monoid.given does not work either.

So is there a way to make this work without importing by name the given?
Something like:

import cats.derived.auto.monoid.given
import cats.derived.auto.semigroup.given

Or:

import cats.derived.auto.monoid.given Monoid[?]
import cats.derived.auto.semigroup.given Semigroup[?]

?

from kittens.

joroKr21 avatar joroKr21 commented on August 17, 2024

What do you mean by "does not work" though?
If I import cats.derived.auto.monoid.given then Monoid[Rebuffers] works.
If I import cats.derived.auto.semigroup.given then Semigroup[Rebuffers] works.

The only issue I can see is that if I import import cats.derived.auto.monoid.given then Semigroup[Rebuffers] doesn't work. I don't know why, but that's the same behaviour as Kittens 3.2:

No given instance of type cats.kernel.Semigroup[Playground.Rebuffers] was found for parameter ev of method apply in object Semigroup.
I found:

    cats.derived.auto.monoid.given_Monoid_A[Playground.Rebuffers](
      /* missing */
        summon[scala.util.NotGiven[cats.kernel.Monoid[Playground.Rebuffers]]]
    )

But no implicit values were found that match type scala.util.NotGiven[cats.kernel.Monoid[Playground.Rebuffers]].

from kittens.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.