Fixes 2861 kos prop monitor backporting#2865
Merged
Dunbaratu merged 3 commits intoKSP-KOS:developfrom Mar 10, 2021
Merged
Conversation
Fixes KSP-KOS#2861 by replacing ProcessOneInputChar()'s use of defaulted optional parameters with just having different explicit signatures instead. This way previously compiled DLLs will pick the right one, which they cannot do with defaulted args because in C# defaulted args are appended at compile-time, not run-time or load-time. If the signature required appending one extra optional arg back when the compiler ran to build the caller's DLL, but it now would need to append two such args, the DLL will still be trying to get away with just appending one. Thus why the kOSPropMonitor DLL still insists on a 3-arg method existing or it won't work. tl;dr - adding more parameters but making them defaulted only provides backward compatibility when all DLLs that call the method are getting recompiled from scratch. It doesn't when the caller is a DLL that's not being recompiled.
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.
Fixes #2861
Made overrides that have signatures matching exactly to what there was before, so they will work with a previously compiled DLL.