parlour icon indicating copy to clipboard operation
parlour copied to clipboard

Allow untyped method signatures to be merged with typed ones

Open AaronC81 opened this issue 3 years ago • 3 comments

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.

AaronC81 avatar Jul 06 '21 22:07 AaronC81

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.

vaporyhumo avatar Jul 06 '21 23:07 vaporyhumo

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?

vaporyhumo avatar Jul 05 '22 15:07 vaporyhumo