-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Regression in scalalandio/chimney
- missing span
#23022
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
Bisect points to b4a802a Minimization: //> using options -Ykind-projector:underscores
trait PatchCollectionWithOptionCollectionRuleModule { self: Derivation =>
protected object PatchCollectionWithOptionCollectionRule extends Rule {
def expand[Patch, A]: DerivationResult[ExpansionResult[A]] = {
// given Type[A] = ???
Type[A] match {
case TotallyOrPartiallyBuildIterable(_) => ??? // couses crash, for some reason it compiles even if not given Type[A]
case _ => ???
}
}
}
}
trait Derivation:
trait DerivationResult[+A]
abstract protected class Rule:
def expand[From, To]: DerivationResult[ExpansionResult[To]]
sealed trait ExpansionResult[+A]
final protected type Type[A] = scala.quoted.Type[A]
object Type:
final def apply[A]: Type[A] = ???
final protected type Existential[F[_]] = Existential.Bounded[Nothing, Any, F]
protected object Existential:
sealed trait Bounded[L, U >: L, F[_ >: L <: U]]
abstract protected class TotallyOrPartiallyBuildIterable[Collection, Item]
object TotallyOrPartiallyBuildIterable:
def unapply[M](implicit M: Type[M]): Option[Existential[TotallyOrPartiallyBuildIterable[M, *]]] = ???
|
@WojciechMazur my PR #23372 fixes the crash, but then your original example errors on -- [E127] Pattern Match Error: local/i23022.scala:8:13 -------------------------
8 | case TotallyOrPartiallyBuildIterable(_) => ??? // couses crash, for some reason it compiles even if not given Type[A]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|TotallyOrPartiallyBuildIterable cannot be used as an extractor in a pattern because it lacks an unapply or unapplySeq method with the appropriate signature
|
| longer explanation available when compiling with `-explain` Which can be fixed by removing the case TotallyOrPartiallyBuildIterable => ??? It's probably an artifact from minimzing. |
I'm not sure if it's correct - wouldn't this mean we're just refering to Also, the code from minimisation correctly does compile in Scala 3.3 LTS and Next versions until 3.7.0 (crashes in 3.7.1) without any changes. Proposed workaround (removing |
Ah right, it'll actually try matching against the object. But the object TotallyOrPartiallyBuildIterable:
def unapply[M](scrutinee: Type[M])(implicit M: Type[M]): Option[...] = ??? and at the call site we have to have the given Type[A] = ???
Type[A] match {
case TotallyOrPartiallyBuildIterable(_) => ???
case _ => ???
} |
Based on OpenCB failure in
scalalandio/chimney
- OpenCB logsCompiler version
Last good revision: 3.7.1-RC1-bin-20250411-f4847cc-NIGHTLY
First bad revision: 3.7.1-RC1-bin-20250412-e70ea84-NIGHTLY
Bisect points to either:
d72e5ea
19dcfa2
However these 2 fail with different errors. The exact commit that introduced regression is not yet known
Not yet minimized
Needs minimisation, unfortunately I won't be able to provide one before 28th April
Output (click arrow to expand)
The text was updated successfully, but these errors were encountered: