When compiling a polymorphically recursive function on a value type, the compiler neither yields a erroneous result nor reports abnormality, but instead loops forever.
Repro steps
For example, try compiling the following code:
[<Struct>] type Nested<'a> = Cons of 'a * Nested<'a list> | Nil
let rec length<'a> : Nested<'a> -> int= function
| Cons (_, xs) -> 1 + length xs
| Nil -> 0
Expected behavior
The compiler should raise an error if such divergence is predictable.
Actual behavior
The compiler fails to terminate.