Implement logic to check previously generated methods to avoid repetition #95
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.
Hello,
This is my implementation of a fix for #92, It also includes some other changes:
I am opening this as a draft for now, because I think this still needs more tests, and I wanted @JumpLink's input about whether he agrees with this solution, as it has a (minor) performance impact.
Another thing I wanted to discuss is if the case of overlapping input/return types in overloads should be dealt by these changes, or if it should be a separated issue (IMO I think so). This seems to be somewhat common, especially with optional and nullable types and sometimes with overlapping union types
![image](https://user-images.githubusercontent.com/9082460/192970131-543f6c14-7ad0-4d3a-ac5b-c1b46c0dae5b.png)
Example (notice the optional for the cancellable argument is the only difference between both
init
definitions):