Keep fields Unity can't serialise out of Unity's serialisation
Unity serialises public fields of [Serializable] classes and behaviours,
and the 6.7 and CoreCLR branch found these ones, whose types Unity can't
serialise (nullables, HashSets, tuples, object), coming up as serialisation
issues under CoreCLR. Unity 6.3 already skips them, so marking them
[NonSerialized] changes nothing on Mono.
Hand-ported from unity_6.7.0's changeset
169906" class="changeset">
169906 (ab1e999ad3c, "Fix some
more serialisation issues that came up when switching to CoreCLR"), with
one difference.
169906" class="changeset">
169906 marks the test runner's JSON fields
(TestRunner.TestDefinition and TestMethodGroup's TimeoutSeconds,
TestListExporter.TestEntry.TimeoutSeconds, TestResultEntry.Parameter)
[NonSerialized, JsonProperty], but Json.NET ignores a [NonSerialized] field
even with [JsonProperty] (checked with Newtonsoft.Json 13.0.3): test lists
would lose their timeouts and results their parameters. Here they become
auto-properties instead, which Unity's serialiser skips and Json.NET reads
and writes by name, as before; only their position in the written JSON
moves after the fields. unity_6.7.0 has the same problem and could take the
same fix.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>