Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursive constructor declared on CompilerMessageAttribute #1273

Closed
mrvoorhe opened this issue Jun 21, 2016 · 1 comment
Closed

Recursive constructor declared on CompilerMessageAttribute #1273

mrvoorhe opened this issue Jun 21, 2016 · 1 comment

Comments

@mrvoorhe
Copy link

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

  1. Open FSharp.Core.dll (I checked versions 4.0, 4.3, 4.4) in ILSpy or ILDASM
  2. Find the type CompilerMessageAttribute
  3. 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

https://github.com/Microsoft/visualfsharp/blob/65b178e13805410f27bed0679f6f2889868b6c96/src/fsharp/FSharp.Core/prim-types.fsi#L653

@dsyme
Copy link
Contributor

dsyme commented Jun 21, 2016

Thanks. Should be fixed with #1274

dsyme added a commit that referenced this issue Jun 22, 2016
Remove recursive constructor declared on CompilerMessageAttribute (Fix #1273)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants