Given I have an enum:
type Cool = A = 'a'
| B = 'b'
And i try to print it like so
printf "%A" Cool.A
I get the following exception:
ToString exception: The value passed in must be an enum base or an
underlying type for an enum, such as an Int32. Parameter name: value
Why does this happen and (if possible) how I can fix this at the enum level?
I can repro this on a machine with F# 2.0 compiler targeting .Net 4.0, but not with F# 2 targeting .Net 3.5 or less, or on a VS2012 (F# 3.0) machine (where .Net 4.5 supersedes 4.0).
I am not sure right now of the cause, but hopefully this info may help you or others narrow it down or find a workaround.