Fix #61604 by simply removing the possibility of throwing an exception in those cases...
authorDavid Wrighton <davidwr@microsoft.com>
Mon, 12 Jun 2023 19:14:25 +0000 (12:14 -0700)
committerGitHub <noreply@github.com>
Mon, 12 Jun 2023 19:14:25 +0000 (12:14 -0700)
src/coreclr/tools/dotnet-pgo/TypeRefTypeSystem/TypeRefTypeSystemType.cs

index e1929cf..2f600a5 100644 (file)
@@ -46,10 +46,10 @@ namespace Microsoft.Diagnostics.Tools.Pgo.TypeRefTypeSystem
             }
             else
             {
-                if (_isValueType.Value != isValueType)
-                {
-                    throw new Exception($"Same type `{ToString()}` used as both ValueType and non-ValueType");
-                }
+                // Do nothing. We cannot choose a correct choice, and failing is also unhelpful, as dotnet-pgo is supposed
+                // to work with traces from the same app over time where a type may have transformed from class to struct
+                // or vice versa. With this approach, the first assembly on the commandline to push a type to be struct
+                // or class will reliably win.
             }
         }