AFAICT F # seems to handle valuetype enums in the same way as C #:
Here's a parsed snippet of IL code from a simple C # program that uses foreach through IEnumerable<T>
.locals init (
[0] valuetype [mscorlib]System.Collections.Generic.List`1/Enumerator<int32>,
[1] int32 v
)
IL_0025: ldloca.s 0
IL_0027: call instance bool valuetype [mscorlib]System.Collections.Generic.List`1/Enumerator<int32>::MoveNext()
Notice what local 0the valuetype type is and what it uses ldloca.sto load the structure address.
Compare this with F #
.locals init (
[0] class [mscorlib]System.Collections.Generic.List`1<int32> ra,
[1] valuetype [mscorlib]System.Collections.Generic.List`1/Enumerator<int32>
)
IL_000e: ldloca.s 1
IL_0010: call instance bool valuetype [mscorlib]System.Collections.Generic.List`1/Enumerator<int32>::MoveNext()
valuetype local 1 ldloca.s .
: F # , # . F # F #, , . , F # . #, F # .
IList, , , - IList "" , .