mongo4cats icon indicating copy to clipboard operation
mongo4cats copied to clipboard

Intellij marks ZMongo usages as errors

Open brndt opened this issue 1 year ago • 4 comments

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

brndt avatar Aug 22 '23 19:08 brndt

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?

Kirill5k avatar Aug 26 '23 10:08 Kirill5k

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

brndt avatar Aug 26 '23 15:08 brndt

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

CodeCombiner avatar Jan 26 '24 14:01 CodeCombiner

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

brndt avatar Jan 31 '24 22:01 brndt