This project is read-only.
1

Resolved

C# compiler emits unverifiable code if multiple lambdas containing declaration expressions are used within the same method

description

Compile and PEVerify:
using System;
using System.Collections.Generic;

class C
{
    static void Main()
    {
        Action a = () => new Dictionary<int, int>().TryGetValue(0, out int value);
        Action b = () => new Dictionary<int, int>().TryGetValue(0, out int value);
    }
}
Verification fails:
[MD] : error : Field has a duplicate, token=0x04000002. [token:0x04000001]
[MD] : error : Field has a duplicate, token=0x04000001. [token:0x04000002]
  2 Error(s) Verifying \ConsoleApplication8\bin\Debug\ConsoleApplication8.exe

comments

VSadov wrote Mar 27, 2014 at 10:38 PM

Fixed in changeset bc3a4be334f029911b2e47dd1f0a92016361c9a6