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>]typeNested<'a>= Cons of'a*Nested<'alist>| Nil
let reclength<'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.
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:
Expected behavior
The compiler should raise an error if such divergence is predictable.
Actual behavior
The compiler fails to terminate.