Repository navigation
Conversation
|
|
||
| for (var definition = type.Resolve(); definition != null && definition.IsNested; definition = definition.DeclaringType) | ||
| { | ||
| if ((definition.IsNestedPrivate || definition.IsNestedFamily || definition.IsNestedFamilyAndAssembly) && !hidden.Contains(definition)) |
There was a problem hiding this comment.
InitializeSerialization still fails on CoreCLR when NetworkVariable<Payload> uses a referenced base's protected internal nested enum without friend access. A derived NetworkBehaviour can legally declare that field using protected access. GetAllFieldsAndResolveGenerics collects Payload, but this predicate does not check IsNestedFamilyOrAssembly. The generated NetworkVariableSerializationHelper cannot access Payload because the helper is outside the base's assembly and inheritance hierarchy. Pass the consuming assembly into CollectTypesHiddenFromAssembly. Reject IsNestedFamilyOrAssembly types when that assembly lacks internal or friend access.
🤖 Helpful? 👍/👎
| type.CollectTypesHiddenFromAssembly(hiddenTypes); | ||
| if (hiddenTypes.Count > 0) | ||
| { | ||
| #if ENABLE_CORECLR |
There was a problem hiding this comment.
The warning/error decision can use the wrong backend when the editor and player runtimes differ. This #if uses the Editor-only ILPP assembly's compile-time defines, while assemblyDefines describes the assembly receiving the generated calls. The CI matrix includes Mono 6000.7 editors building CoreCLR players. If their ENABLE_CORECLR values differ, code generation only warns and retains calls that CoreCLR rejects. Select the branch using assemblyDefines.Contains("ENABLE_CORECLR").
🤖 Helpful? 👍/👎
Codecov ReportAll modified and coverable lines are covered by tests ✅ @@ Coverage Diff @@
## develop-3.x.x #4239 +/- ##
==============================================
Coverage 76.90% 76.90%
==============================================
Files 159 159
Lines 27663 27663
==============================================
Hits 21274 21274
Misses 6389 6389
Flags with carried forward coverage won't be shown. Click here to find out more. see 5 files with indirect coverage changes
|
|
|
||
| CoreCLR introduces a new compilation pipeline that changes some custom serialization generation. | ||
|
|
||
| ## NetworkVariable serialization |
There was a problem hiding this comment.
| ## NetworkVariable serialization | |
| ### NetworkVariable serialization |
Just to make it clear that this is related to the CoreCLR stuff above.
Purpose of this PR
When we generate the serialization code for NetworkVariables, we add code at the assembly level. Mono, for whatever reason, didn't complain if there were private or protected types in the serialization generation code. CoreCLR throws an error if we try to generate serialization for private types.
This PR detects this case and logs a warning in Mono, and an error in CoreCLR. This gives users a human-readable error message with information on how to fix the issue, and lets the code generation safely continue.
Jira ticket
UUM-156224
Changelog
Documentation
Testing & QA (How your changes can be verified during release Playtest)
Functional Testing
Manual testing :
Manual testing doneAutomated tests:
Covered by existing automated testsCovered by new automated testsDoes the change require QA team to:
Review automated tests?Execute manual tests?Provide feedback about the PR?If any boxes above are checked the QA team will be automatically added as a PR reviewer.
Up-port
n/a
Backports
2.x doesn't need to support CoreCLR