ILSpy icon indicating copy to clipboard operation
ILSpy copied to clipboard

Latest ILSpy produce dup names

Open CreateAndInject opened this issue 3 years ago • 3 comments

I update ILSpy from .NET 4.7.2 to .NET 6

	Workbook workbook = new Workbook(string_0);
	Worksheet worksheet = null; // 1. worksheet
	string text = "保温规格代号";
	foreach (Worksheet worksheet in workbook.Worksheets) // 2. worksheet
	{
		if (worksheet.Cells[0, 0].StringValue == text)
		{
			worksheet = worksheet;
			break;
		}
	}

Old ILSpy doesn't have such issue

CreateAndInject avatar Jul 16 '22 21:07 CreateAndInject

Seems produced in the latest commit : https://github.com/icsharpcode/ILSpy/commit/6584a2f5763256e2298dd9b5d859d7bb95ac4193

CreateAndInject avatar Jul 16 '22 21:07 CreateAndInject

Can you provide us with a sample that produces this?

christophwille avatar Jul 17 '22 06:07 christophwille

Build following code and delete .pdb file

internal class Program
{
    static void Main(string[] args)
    {
        Product product = null;
        foreach (var pro in Products)
        {
            if (pro != null)
            {
                product = pro;
                break;
            }
        }
        Test(product);
    }

    public static IList<Product> Products { get; set; }

    public static void Test(Product product)
    {
    }
}

class Product
{

}

@christophwille ILSpy already revert that commit, does it mean your team already can reproduce it? If you want to test, reset to that commit.

CreateAndInject avatar Jul 17 '22 14:07 CreateAndInject

I think this can be closed as I can no longer reproduce the problem using the above snippet and we've rolled back the initial change that triggered this bug.

siegfriedpammer avatar Dec 04 '22 16:12 siegfriedpammer