Input code
record WebPair7(string name, string? value, ref readonly object encode)
{
public string? Value { get; } = name;
public string Name { get; } = value;
string? WebValue { get; } = name != null ? "111" : value;
string? WebValue2;
}
Erroneous output
// TestClassPropertyInit, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// TestClassPropertyInit.WebPair7
using System.Runtime.CompilerServices;
internal record WebPair7
{
public string name { get; init; }
public string? value { get; init; }
public object encode { get; init; }
public string? Value { get; }
public string Name { get; }
private string? WebValue { get; }
private string? WebValue2;
public WebPair7(string name, string? value, ref readonly object encode)
{
this.name = name;
this.value = value;
this.encode = encode;
Value = name;
Name = value;
WebValue = ((name != null) ? "111" : value);
base..ctor();
}
[CompilerGenerated]
public void Deconstruct(out string name, out string? value, out object encode)
{
name = this.name;
value = this.value;
encode = this.encode;
}
}
The line base..ctor(); appeared.
Details
This commit in my original PR actually included this example and provided a fix, but it seems you might have overlooked it. Based on my local testing, even after your recent 10+ revisions regarding primary constructors, the current implementation is still not as robust as what was in my original PR.
Therefore, I strongly recommend once again that you review the individual commit history of my PR. There are many details in my code that you haven't captured yet, which I have also explained multiple times in previous GitHub Issue comments.
Thank you. Perhaps it is not my place to offer advice, and I realize this might be hard to accept emotionally, but I simply wish for ILSpy to be as perfect as possible.
Input code
Erroneous output
The line
base..ctor();appeared.Details
This commit in my original PR actually included this example and provided a fix, but it seems you might have overlooked it. Based on my local testing, even after your recent 10+ revisions regarding primary constructors, the current implementation is still not as robust as what was in my original PR.
Therefore, I strongly recommend once again that you review the individual commit history of my PR. There are many details in my code that you haven't captured yet, which I have also explained multiple times in previous GitHub Issue comments.
Thank you. Perhaps it is not my place to offer advice, and I realize this might be hard to accept emotionally, but I simply wish for ILSpy to be as perfect as possible.