Repository navigation
fix(weaver): cross assembly NetworkBehaviour fixes - #1229
Merged
Merged
Conversation
…assemblies Weaver weaves base types from referenced assemblies in memory because ILPP references are not post processed. Those modules used cecil's default reflection importer, so generated methods had types scoped to System.Private.CoreLib, which leaked into the weaved assembly when it called the base methods. Unity then refuses to load that assembly after an editor restart.
…stead of the base type's module MakeHostInstanceGeneric and MatchGenericParameters imported into the base type's module. When the base type is in another assembly, type args from the weaved assembly get scoped to an assembly reference there, so re-importing them gives the weaved assembly a reference to itself, which Unity refuses to load after an editor restart. MakeHostInstanceGeneric, GetMethodInBaseType and MatchGenericParameters now take the module that uses the reference. Adds cross-assembly generic NetworkBehaviour tests, including a generic middle class.
…lared in another assembly The non-generic field to property replacement used the base type's generated methods (and field type for ldflda/initobj) directly, which fails to write with 'declared in another module and needs to be imported'. Adds tests setting SyncVar fields declared in another assembly. They only check server side values, syncing to clients is not supported for cross assembly SyncVar fields yet.
…ot compiled against A bad import (eg the weaver's own System.Private.CoreLib, or an assembly referencing itself) writes fine and works until the editor restarts, then Unity refuses to load the assembly. Checking references before write turns that into a weaver error naming the reference. Allowed references are the assembly's original references plus compiledAssembly.References, because the weaver can legitimately add references the compiler did not need.
Contributor
|
🎉 This PR is included in version 159.3.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.