Follow-up to #447.
Root cause confirmed
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.
Follow-up to #447.
Root cause confirmed
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 ofop_HatEqualsis not supportedatAether.Optic.set. Broken on10.0.400, works on10.0.303. Open, Backlog, unassigned, no fix PR yet.What we additionally verified locally
Optic.set/^=.Optic.get/^.and lens composition>->hit the same failure mode (repro'd inGenCORE.Lib/MinMax.fsandGenCORE.Lib/Patient.fsunder 10.0.400).fst/snd) does avoid it, verified against 10.0.400.Current mitigation
PR #449 pins
global.jsonto10.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.