You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* `ArrayProduct`
* `EmptyProduct`
* `productElement`
These helpers are not mandated by the spec, nor used by the
compiler. They were used in a few tests for typeclass derivation,
but it does not seem that they are fundamental. We now use
replacements in the relevant tests.
`EmptyProduct` can be replaced by `EmptyTuple`.
`ArrayProduct` seems to be used by "unpickling" kinds of
derivations (an impression confirmed by the community build). This
is too specific a use case to be defined generally in
`scala.deriving`. Moreover, it is not clear why Arrays receive
special treatment, but not other kinds of sequences or even
immutable arrays. `ArrayProduct` can be replaced by a custom
`new Product {...}` wrapper, which in the case of our tests ends up
being simpler than the "feature-rich" `ArrayProduct`.
`productElement` seems to be more generally useful, but at the same
time is very unsafe, and is not hard to re-implement. Removing it
forces the call sites to perform the `asInstanceOf`s themselves,
which is not a bad thing as it allows to better reason about the
code. In particular, our tests benefitted from pushing the cast to
`Product` ahead in the call chain, at a place where it is
relatively easier to convince oneself that the value is indeed a
`Product`.
0 commit comments