Fix IL2CPP build crash on Unity 6000.0.x caused by multiple implement…#203
Merged
sierpinskid merged 1 commit intodevelopfrom Apr 10, 2026
Merged
Conversation
…ations of the same generic interface IL2CPP's vtable builder in Unity 6000.0.x crashes with a KeyNotFoundException in VTableBuilderComponent.OverrideInterfaceMethods when a type implements multiple closed versions of the same generic interface (e.g. ISavableTo<A> and ISavableTo<B>). The vtable builder uses an unresolved generic parameter name as a dictionary key instead of the resolved concrete type, causing a key mismatch during vtable construction. The bug is fixed in Unity 6000.2.x but affects customers on 6000.0.x. This pattern existed across four internal generic interfaces in the SDK: ISavableTo (9 types), ILoadableFrom (9 types), IUpdateableFrom (4 types), and IStateLoadableFrom (5 types) — 27 types total. Fix: for each interface, introduce numbered variants (e.g. ISavableTo2, ILoadableFrom2/3/4, IUpdateableFrom2/3/4/5, IStateLoadableFrom2) that are structurally identical but distinct in the type system. Each type's secondary and tertiary implementations are moved to the numbered variant, so no type ever implements multiple closed versions of the same generic interface. Matching extension method overloads ensure all existing functionality and DTO conversions are preserved.
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.
…ations of the same generic interface
IL2CPP's vtable builder in Unity 6000.0.x crashes with a KeyNotFoundException in VTableBuilderComponent.OverrideInterfaceMethods when a type implements multiple closed versions of the same generic interface (e.g. ISavableTo and ISavableTo). The vtable builder uses an unresolved generic parameter name as a dictionary key instead of the resolved concrete type, causing a key mismatch during vtable construction. The bug is fixed in Unity 6000.2.x but affects customers on 6000.0.x.
This pattern existed across four internal generic interfaces in the SDK: ISavableTo (9 types), ILoadableFrom (9 types), IUpdateableFrom (4 types), and IStateLoadableFrom (5 types) — 27 types total.
Fix: for each interface, introduce numbered variants (e.g. ISavableTo2, ILoadableFrom2/3/4, IUpdateableFrom2/3/4/5, IStateLoadableFrom2) that are structurally identical but distinct in the type system. Each type's secondary and tertiary implementations are moved to the numbered variant, so no type ever implements multiple closed versions of the same generic interface. Matching extension method overloads ensure all existing functionality and DTO conversions are preserved.