In EncodedEvent.serializeUnionByCaseItemType and its inverse there is a reliance on a Seq.exactlyOne.
This should be replaced with a cached DU-level consistency verification with a clear message using a technique such as that in
|
let converters<'a> = |
|
let valueConverters = |
|
getValues typeof<'a>.Assembly |
|
|> Seq.map valueConverter |
|
|> Seq.toList |
|
[ unionConverter; optionConverter] |
|
@ valueConverters |
allowing the actual lookup to just be on a find-first basis.