sord
sord copied to clipboard
second curly bracket is removed when block is used as a param
To Reproduce
class A
def x(a: ->() {}); end
end
Expected behavior
class A
# sord omit - no YARD type given for "a:", using untyped
# sord omit - no YARD return type given, using untyped
sig { params(a: T.untyped).returns(T.untyped) }
def x(a: ->() {}); end
end
Actual behavior
class A
# sord omit - no YARD type given for "a:", using untyped
# sord omit - no YARD return type given, using untyped
sig { params(a: T.untyped).returns(T.untyped) }
def x(a: ->() {); end
end
- def x(a: ->() {); end
+ def x(a: ->() {}); end
Failing test: https://github.com/AaronC81/sord/pull/137
I reckon this is because of the workaround in #127 to fix a YARD bug. The default parameter in your example kind of begins with a unary minus symbol, but it's actually a ->
.
I'll take a look at this in the next couple of days! I don't think it should be too tricky to exclude this case from that workaround.
Just tidying up - already fixed by #137, so closing :)