Kirill5k / mongo4cats

MongoDB Java client wrapper for Cats Effect & FS2 and ZIO
https://kirill5k.github.io/mongo4cats/docs/
Apache License 2.0
107 stars 22 forks source link

Intellij marks ZMongo usages as errors #34

Open brndt opened 1 year ago

brndt commented 1 year ago

I know Intellij is buggy sometimes when working with Scala 3 but can we somehow bypass the display of these errors? I suppose it ocurres because Intellij finds object and trait in the package simultaneously and cannot decide which one it is referring to :)

Screenshot 2023-08-22 at 21 15 34 Screenshot 2023-08-22 at 21 12 43
Kirill5k commented 1 year ago

The error that you have on the first screenshot is correct: ZMongoClient does not take any type arguments. it should just be:

database <- ZIO.serviceWithZIO[ZMongoClient](_.getDatabase(config.database))

The second error is quite weird though, Intellij shouldn't be complaining about it.

Out of curiosity, if you run code from this example, will your IDE show errors there as well?

brndt commented 1 year ago

The error that you have on the first screenshot is correct: ZMongoClient does not take any type arguments. it should just be

Yes I know, I just added two parameters in order to show that Intellij is behaving weird saying opposite things in the hint. If you don't pass any parameters, it says you should add one; if you pass one, it says you shouldn't pass any; if you pass two, it says both things.

Out of curiosity, if you run code from this example, will your IDE show errors there as well?

Yes:

Screenshot 2023-08-26 at 17 39 52
CodeCombiner commented 8 months ago

Having the same issue on the latest Idea *it compiles and runs well

brndt commented 8 months ago

https://youtrack.jetbrains.com/issue/SCL-21547