-
Notifications
You must be signed in to change notification settings - Fork 1.1k
3.3.0-RC4 -Wunused:imports
false positive for imports that are only used in imports
#17314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
-Wunused:imports
false positive for imports that are only used in imports-Wunused:imports
false positive for imports that are only used in imports
One file, no dependency minimization: package circelike {
import java.net.URI
import scala.compiletime.{erasedValue, summonInline}
import scala.deriving.Mirror
type Codec[T]
type Configuration
trait ConfiguredCodec[T]
object ConfiguredCodec:
inline final def derived[A](using conf: Configuration)(using
inline mirror: Mirror.Of[A]
): ConfiguredCodec[A] =
new ConfiguredCodec[A]:
val codec = summonInline[Codec[URI]] // simplification
}
package foo {
import java.net.URI
import circelike.{Codec, Configuration}
given Configuration = ???
given Codec[URI] = ???
}
package bar {
import java.net.URI
import circelike.Codec
import circelike.{Configuration, ConfiguredCodec}
import foo.{given Configuration, given Codec[URI]}
case class Operator(url: URI) derives ConfiguredCodec
}
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Compiler version
3.3.0-RC4
Minimized code
Define some givens in a base package:
Import those givens explicitly by type in another package:
Output
The compiler gives the following warnings:
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.ConfiguredCodec.derived
expects aConfiguration
instance to be in the implicit scope.Codec[URI]
will be used while deriving the ConfiguredCodec.The text was updated successfully, but these errors were encountered: