Skip to content

Regression in indoorvivants/genovese #22070

Closed
@WojciechMazur

Description

@WojciechMazur

Based on OpenCB failure in indoorvivants/genovese - build logs

Related issues (same bisect result): #22068 #22062

Compiler version

Last good release: 3.6.4-RC1-bin-20241121-5d1d274-NIGHTLY
First bad release: 3.6.4-RC1-bin-20241122-64411b6-NIGHTLY
Bisect points to 26ecda5

Minimized code

case class Breaks(x: Boolean, y: Boolean) derives Featureful
object types:
  opaque type NormalisedFloat <: Float = Float
import types.*

enum Feature[T]:
  case Bool extends Feature[Boolean]
  def fromNormalisedFloat(value: NormalisedFloat): this.type#T = ???

trait Featureful[T]:
  def features: IArray[Feature[?]]
  def toFeatures(value: T): IArray[NormalisedFloat]

object Featureful:
  inline def derived[T](using scala.deriving.Mirror.Of[T]) = ${ derivedImpl[T] }

  import scala.quoted.*
  private def derivedImpl[T: Type](using Quotes): Expr[Featureful[T]] =
    import quotes.reflect.*
    '{
      new Featureful[T]:
        override val features: IArray[Feature[?]] = IArray.empty

        override def toFeatures(value: T): IArray[NormalisedFloat] =
          val feats = IArray.empty[Featureful[?]]
          val product = value.asInstanceOf[Product]
          product.productIterator.zipWithIndex.foreach: (any, idx) =>
            val error = feats(idx).toFeatures(any.asInstanceOf)
          IArray.empty
    }

Output

Compiling project (Scala 3.6.4-RC1-bin-20241201-6bf4483-NIGHTLY, JVM (17))
[error] ./test-usage.scala:1:51
[error] Found:    Featureful[?]#T
[error] Required: Nothing
[error] case class Breaks(x: Boolean, y: Boolean) derives Featureful
[error]       

Expectation

Should compile

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions