Merged
Conversation
Currently, a bug exists in merging of interfaces such that if one interface exports a function that references an exported (i.e. "named") type and another interface exports a different function that references the same exported type, the merged interface would have references to function types with types that are not present in the "encoded type index" map. This results in the encoder re-encoding the same type and using that newly encoded type index instead of the correct type index to the named type. Ultimately this resulted in a validation error of the encoded output where the interface wasn't valid for import because of the function not using what should be a named value type. The fix is for the merged interface to maintain a mapping between the new type and the old types so that the "encoded type index" map is updated accordingly.
JSON only supports string keys in maps and the remapped types isn't needed in the `resolve` command output.
fibonacci1729
approved these changes
Nov 30, 2023
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.
Currently, a bug exists in merging of interfaces such that if one interface exports a function that references an exported (i.e. "named") type and another interface exports a different function that references the same exported type, the merged interface would have references to function types with types that are not present in the "encoded type index" map.
This results in the encoder re-encoding the same type and using that newly encoded type index instead of the correct type index to the named type.
Ultimately this resulted in a validation error of the encoded output where the interface wasn't valid for import because of the function not using what should be a named value type.
The fix is for the merged interface to maintain a mapping between the new type and the old types so that the "encoded type index" map is updated accordingly.