Description
I'm working toward getting IL2CPP to convert FSharp.Core.dll and I stumbled on some problematic IL. Looking at the IL for CompilerMessageAttribute, there is a recursive constructor declared that has an empty body. The C++ that IL2CPP generates for this constructor ends up causing a compiler warning because the code is infinitely recursive.
.method assembly specialname rtspecialname
instance void .ctor (
object message,
object messageNumber
) cil managed
{
// Method begins at RVA 0x258c
// Code size 10 (0xa)
.maxstack 8
IL_0000: nop
IL_0001: ldarg.0
IL_0002: ldarg.1
IL_0003: ldarg.2
IL_0004: callvirt instance void Microsoft.FSharp.Core.CompilerMessageAttribute::.ctor(object, object)
IL_0009: ret
} // end of method CompilerMessageAttribute::.ctor
Repro steps
Provide the steps required to reproduce the problem
- Open FSharp.Core.dll (I checked versions 4.0, 4.3, 4.4) in ILSpy or ILDASM
- Find the type CompilerMessageAttribute
- Notice there are two constructors. The expected one CompilerMessageAttribute(string, int), and the problematic CompilerMessageAttribute(object, object)
Expected behavior
I don't believe this constructor should exist.
Related information
Notes from @ReedCopsey :
https://github.com/Microsoft/visualfsharp/blob/65b178e13805410f27bed0679f6f2889868b6c96/src/fsharp/FSharp.Core/prim-types.fs#L348