Home General

[Bug] Exception thrown by LINQPad while using Util.Dif

Dear developers,

I'm facing a bug that, I think, is coming from the internal implementation of the diffing system of LINQPad. I could craft an MWE to demonstrate the issue:

Recipe[] oldManifest = [
new Recipe("libnetplan1", "1.1-r0.0"),
new Recipe("libnfnetlink0", "1.0.2-r0.0"),
new Recipe("libnftnl11", "1.2.7-r0.0"),
new Recipe("libnghttp2-14", "1.63.0-r0.0"),
new Recipe("libnl-3-200", "1:3.10.0-r0.0"),
new Recipe("libnl-3-doc", "1:3.10.0-r0.0"),
new Recipe("libnl-genl-3-200", "1:3.10.0-r0.0"),
new Recipe("libnsl3", "2.0.1-r0.0"),
new Recipe("libnss-mdns", "0.15.1-r0.0"),
new Recipe("libnss-myhostname2", "1:256.5-r0.0"),
new Recipe("libnss-systemd2", "1:256.5-r0.0"),
new Recipe("libogg-doc", "1.3.5-r0.0"),
new Recipe("libogg0", "1.3.5-r0.0"),
new Recipe("libpam", "1.6.1-r0.0"),
];

Recipe[] newManifest = [
new Recipe("libnetplan1", "1.1.2-r0.0"),
new Recipe("libnfnetlink0", "1.0.2-r0.0"),
new Recipe("libnftnl11", "1.2.8-r0.0"),
new Recipe("libnghttp2-14", "1.65.0-r0.0"),
new Recipe("libnl-3-200", "1:3.11.0-r0.0"),
new Recipe("libnl-3-doc", "1:3.11.0-r0.0"),
new Recipe("libnl-genl-3-200", "1:3.11.0-r0.0"),
new Recipe("libnss-myhostname2", "1:257.4-r0.0"),
new Recipe("libnss-systemd2", "1:257.4-r0.0"),
new Recipe("libogg-doc", "1.3.5-r0.0"),
new Recipe("libogg0", "1.3.5-r0.0"),
new Recipe("libpam", "1.7.0-r0.0"),
];

// It seems the dump command for the diff is bugged on LINQPad 8.106.5 and throws
Util.Dif(oldManifest, newManifest).Dump();

record Recipe(string Name, string Version);// {private string Version;};

In this particular MWE, I have the feeling the bug occurs when the logic tries to diff the property "string Version" (certainly an ill edge case not handled by the implementation under a specific condition that this MWE meets). To prove this, uncomment the part {private string Version;}; to turn the property into a private field so that it won't be part of the diff. This change prevents the Dif method from raising an exception.

Here is the exception I get:

Hoping this will help to get it fixed :)
Cheers

Comments

Sign In or Register to comment.