I have a piece of code where I am explicitly passing a type parameter which is picked up just fine by intelliJ and there is no error pointed out by intelliJ, but when I use system sbt to compile the same code it doesn't pick up the type parameter and get confused with multiple matching implicit types in the scope.
Code in intelliJ with no error flagged :
Error stack when compiled on system sbt :
[error] one error found
[error] /Users/xxxxxx/projects/xxxxx-xxxxxx-xxxxxx/xxxxxxxxx/src/main/scala/com/xxxxxxx/Main.scala:93:33: ambiguous implicit values:
[error] both lazy value AsyncBlobIO in trait Instances of type => cats.effect.Async[doobie.free.BlobIO]
[error] and lazy value AsyncCallableStatementIO in trait Instances of type => cats.effect.Async[doobie.free.CallableStatementIO]
[error] match expected type cats.effect.Sync[F]
[error] result <- jobPaths(Paths.get(record.path), settings.baseFolder).use(paths => ingestionJob(record, paths))
[error] ^
As you can see the system sbt doesn't pick type argument jobPaths[IO](..)
instead just runs jobPaths(..)
for some reason.
JobPaths
functions definition if that helps :
def runJob[F[_]](
settings: Settings,
now: Instant,
consulSessionName: String,
assignerConfig: PartitionKeyAssignerConfig
)(implicit F: ConcurrentEffect[F], p: Parallel[F]): F[Unit] = {
system sbt version :
[info] 1.2.8
sbt script version: 1.3.12
Am I looking at the problem the right way? or this is caused by something else?
Anything would be helpful.