Open 2m opened 1 year ago
Subtly enough, uncommenting the first val makes the warning go away. Oh obviously, that's because it sees the usage.
A NamedArg
is an "early tree" that requires special handling.
Confirmed broken on 3.5.1 and fixed by the linked PR.
import scala.deriving.Mirror
case class Test(i: Int, d: Double)
case class Decoder(d: Product => Test)
// OK, no warning returned
// val ok = Decoder(summon[Mirror.Of[Test]].fromProduct)
//
// returns warning:
// [warn] unused import
// [warn] import scala.deriving.Mirror
val d = Decoder(d = summon[Mirror.Of[Test]].fromProduct)
Compiler version
3.3.0
and3.3.1-RC4
Minimized code
Output
Expected
No warnings