Skip to content

Remove whitebox cast from GenIso.fields#1602

Merged
julien-truffaut merged 1 commit into
optics-dev:masterfrom
mbovel:remove-geniso-whitebox
Jul 13, 2026
Merged

Remove whitebox cast from GenIso.fields#1602
julien-truffaut merged 1 commit into
optics-dev:masterfrom
mbovel:remove-geniso-whitebox

Conversation

@mbovel

@mbovel mbovel commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Fixes the master build, broken since #1574: the fallback arm of GenIso._fields passed the new wildcard-typed IsoFields[S] expression to whitebox[A](e: Expr[Iso[S, A]]), which no longer typechecks.

Rather than patching the cast, remove whitebox entirely and declare the honest supertype PIso[S, S, ?, ?], as #1574 did for IsoFields. All match arms conform without a cast, and transparent inline still infers the precise type at call sites.

Verified with sbt 'project rootJVM' '++ 3' test (all tests pass, including GenIso.fields on 0-, 1- and 2-field case classes) and scalafmtCheck.

🤖 Generated with Claude Code

@mbovel

mbovel commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

Ah, I didn't see #1600. I will rebase.

Removing whitebox entirely seems like a better fix to me. What do you think?

Declare the honest supertype PIso[S, S, ?, ?] instead, as optics-dev#1574 did for
IsoFields. All match arms conform without a cast, and transparent inline
still infers the precise type at call sites. This also fixes the master
build, broken since optics-dev#1574.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mbovel mbovel force-pushed the remove-geniso-whitebox branch from 01117f2 to ea22e64 Compare July 13, 2026 16:57
@julien-truffaut

Copy link
Copy Markdown
Member

Yes it does!

@julien-truffaut julien-truffaut merged commit 2de8183 into optics-dev:master Jul 13, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants