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
Not our code, not Aether-specific. Upstream F# compiler regression, filed independently the same day: dotnet/fsharp#20253, "SDK 10.0.400 regression: cross-assembly inline SRTP call throws in Release." Identical repro: Aether 8.3.1, Dynamic invocation of op_HatEquals is not supported at Aether.Optic.set. Broken on 10.0.400, works on 10.0.303. Open, Backlog, unassigned, no fix PR yet.
What we additionally verified locally
Not limited to Optic.set/^=. Optic.get/^. and lens composition >-> hit the same failure mode (repro'd in GenCORE.Lib/MinMax.fs and GenCORE.Lib/Patient.fs under 10.0.400).
Eta-expanding call sites does not fix it, the compiler still emits an internal curried closure that fails.
Bypassing Aether's dispatch and calling the Lens/Prism tuple's functions directly (fst/snd) does avoid it, verified against 10.0.400.
Current mitigation
PR #449 pins global.json to 10.0.302/latestPatch. Sufficient until upstream fixes #20253.
Optional follow-up (not urgent while the pin holds)
Replace Aether with a small hand-rolled, non-generic Lens/Prism module (get/set/compose as plain functions) across the affected files: MinMax.fs, GenCORE.Lib/Patient.fs, GenORDER.Lib/Patient.fs, ZForm.Lib/DoseRule.fs, PatientCategory.fs. To remove the dependency and this whole class of SRTP fragility. Track dotnet/fsharp#20253 before considering unpinning the SDK.
This is one of those Haskelisms that creep in where it looks like a good idea then you later just go with the simple option. Sometimes boilerplate is good. The awful use of SRTP etc lead me to build Myriad (Mryiad lenses) so no one has to put themselves through composing those monstrosities. I think people choose yo use optic's libs rather than gen them with Myriad though, sometime people like to shoot themselves through the foot for fun for a while though :-p .
This is one of those Haskelisms that creep in where it looks like a good idea then you later just go with the simple option. Sometimes boilerplate is good. The awful use of SRTP etc lead me to build Myriad (Mryiad lenses) so no one has to put themselves through composing those monstrosities. I think people choose yo use optic's libs rather than gen them with Myriad though, sometime people like to shoot themselves through the foot for fun for a while though :-p .
I think replacing this with Myriad lenses would be great! Again using AI this should be easy. Do you want to hand this over to me or would you rather want this resolved by yourself?
For this a simple optics module will suffice, only the parts that benefit from optics will be applied like: ZForm.Lib/DoseRule.fs where there's 169 compositions that would be otherwise introduced, for other places where there is no advantage to using optics we can just factor usages out to simplify.
We cant use Myriad unless the lens module is updated as Myriad only support optics with one element. Its trivial to extend but its an extra step where here, we just want to reduce risk and factor out that aspect. If there are other area where Myriad could help then it would make more sense to embrace Myriad but without analysis I simply don't know.
Activity
halcwb commentedon Aug 14, 2026
I think we should even consider if and how we should use Aether. This is one of those places where I thought, this looks cool, but didn't really think over the broader consequences and consistent usage. This also was before the F# nested record fields accessors: https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/copy-and-update-record-expressions.
7sharp9 commentedon Aug 14, 2026
We can patch this pretty easy for now by replacing:
With
Or going further, a tiny optics lib that doesn't use fragile SRTP.
Or just factor out optic style and just use nested field accessors.
halcwb commentedon Aug 14, 2026
I agree, this could be a typical case of YAGNI.
That said. The ZForm lib makes quite extensive use of optics. But this is a typical case where AI could do a lot of the heavy lifting.
7sharp9 commentedon Aug 14, 2026
This is one of those Haskelisms that creep in where it looks like a good idea then you later just go with the simple option. Sometimes boilerplate is good. The awful use of SRTP etc lead me to build Myriad (Mryiad lenses) so no one has to put themselves through composing those monstrosities. I think people choose yo use optic's libs rather than gen them with Myriad though, sometime people like to shoot themselves through the foot for fun for a while though :-p .
halcwb commentedon Aug 14, 2026
I think replacing this with Myriad lenses would be great! Again using AI this should be easy. Do you want to hand this over to me or would you rather want this resolved by yourself?
7sharp9 commentedon Aug 24, 2026
For this a simple optics module will suffice, only the parts that benefit from optics will be applied like:
ZForm.Lib/DoseRule.fswhere there's 169 compositions that would be otherwise introduced, for other places where there is no advantage to using optics we can just factor usages out to simplify.We cant use Myriad unless the lens module is updated as Myriad only support optics with one element. Its trivial to extend but its an extra step where here, we just want to reduce risk and factor out that aspect. If there are other area where Myriad could help then it would make more sense to embrace Myriad but without analysis I simply don't know.
halcwb commentedon Aug 25, 2026
Took this off the first MVP project as an issue, this can be handled later on.
7sharp9 commentedon Aug 25, 2026
Ah ok, I had started this one, I'll park the branch and come back to it later.
refactor: remove the Aether optics dependency (#450)
docs: drop closed-issue references from code comments