Skip to content

Commit

Permalink
Add .field init type check
Browse files Browse the repository at this point in the history
  • Loading branch information
riverar committed Mar 22, 2023
1 parent aae36d3 commit 7a230ab
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sources/WinmdUtils/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1139,6 +1139,13 @@ private static bool CompareFields(IField field1, IField field2, DifferencesWrite
writer.WriteDifference($"winmd2: {fullField1Name} is a constant with a null value");
}

var fieldInitType1 = fieldVal1.GetType().Name;
var fieldInitType2 = fieldVal2.GetType().Name;
if (fieldInitType1 != fieldInitType2)
{
writer.WriteDifference($"{fullField1Name} value init changed {fieldInitType1}->{fieldInitType2}");
}

string val1 = fieldVal1?.ToString();
string val2 = fieldVal2?.ToString();

Expand Down

0 comments on commit 7a230ab

Please sign in to comment.