Closed
Description
Compiler version
3.3.0-RC4
Minimized code
Define some givens in a base package:
package com.base
import java.net.URI
import io.circe.Codec
import io.circe.derivation.Configuration
given Configuration = ???
given Codec[URI] = ???
Import those givens explicitly by type in another package:
package com.base.models
import java.net.URI
import io.circe.Codec
import io.circe.derivation.{Configuration, ConfiguredCodec}
import com.base.{given Configuration, given Codec[URI]}
case class Operator(url: Option[URI]) derives ConfiguredCodec
Output
The compiler gives the following warnings:
import io.circe.Codec
^^^^^
unused import
import io.circe.derivation.{Configuration, ConfiguredCodec}
^^^^^^^^^^^^^
unused import
import com.base.{given Configuration, given Codec[URI]}
^^^^^^^^^^^^^^^^
unused import
Expectation
No warning should be emitted. Please note:
Configuration
andCodec
were only imported to be used inimport com.base.{given Configuration, given Codec[URI]}
the rest of the file does not use those types.- the method
ConfiguredCodec.derived
expects aConfiguration
instance to be in the implicit scope. Codec[URI]
will be used while deriving the ConfiguredCodec.