sig {params(name: String).returns(Integer)}
def main(name)
puts "Hello, #{name}!"
name.length
end
I think the idea is that Asqi should treat `sig {}` sort of like a comment: prefix metadata attached to `def main`, rather than as an unrelated imperative call (whereas `attr_reader` would not have this behavior). Do you know whether Sorbet continues to work if you alias `sig` and any of its other definitions? For example, can I do this? def mysig(&proc)
sig(&proc) # or some other transformation
end
mysig {params(name: String).returns(Integer)} # does this work? I hope/assume not
def foo(name)
name.length
end
If the above is disallowed, then it should be easy to implement Ruby with Sorbet support built in. Otherwise I can probably do Ruby by itself, but it would be unaware of annotations attached to methods since to my knowledge there's normally no structural connection between statements that precede definitions.No, it doesn't work if you alias