Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow untyped method signatures to be merged with typed ones #119

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

AaronC81
Copy link
Owner

@AaronC81 AaronC81 commented Jul 6, 2021

This PR adds a special case to the conflict resolver so that "untyped" methods (ones where every parameter and the return type is T.untyped, such as those defined in Ruby source without a signature) can be automatically merged with their type signatures definitions.

Previously, merging these two definitions would've caused a conflict resolver error:

def int_to_str(i)
  i.to_s
end
sig { params(i: Integer).returns(String) }
def int_to_str(i); end

But this now works as expected, keeping only the one with the sig.

Closes #115.

@Bo98 @vaporyhumo If you get a chance to test it out, I'd be curious to know if this fixes the conflict issue you were having! It seems to fix it for the minimal example in the issue.

@rodrigovilina
Copy link

rodrigovilina commented Jul 6, 2021

I did change the code a little so I no longer have the conflict, but I'll try to reproduce and test if it was fixed.

EDIT: I haven't had a chance to look at this yet; I did try to reproduce the same error but I kinda lost it in the changes I made. Still, I am getting errors so as soon as I'm able I'll update on this.

@rodrigovilina
Copy link

Hey @AaronC81, just doing some decluttering on my side, I no longer haver the project which had this conflict, so I have no way of really helping with this. I figure that maybe this has already been solved?

@rodrigovilina
Copy link

I'd guess this is safe to delete?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Conflict resolver doesn't handle type signatures contained in a separate RBI file to the main code
2 participants