Ignore anonymous helpers instead of raising an exception.
The Tapioca compiler requires helper methods to be declared inside a named module rather than an anonymous helpers do ... end block in order to generate a proper RBI definition that Sorbet can use to know that the helper methods exist.
The initial version of the Tapioca compiler raised an exception when encountering anonymous helpers do ... end blocks to help enforce this. However this is at least one case in which the block form of helpers must be used: defining reusable params, e.g.:
helpers do
params :pagination do
optional :page, type: Integer
optional :per_page, type: Integer
end
end
This PR updates the compiler to simply skip over anonymous helpers blocks.
Ignore anonymous helpers instead of raising an exception.
The Tapioca compiler requires helper methods to be declared inside a named module rather than an anonymous
helpers do ... end
block in order to generate a proper RBI definition that Sorbet can use to know that the helper methods exist.The initial version of the Tapioca compiler raised an exception when encountering anonymous
helpers do ... end
blocks to help enforce this. However this is at least one case in which the block form ofhelpers
must be used: defining reusable params, e.g.:This PR updates the compiler to simply skip over anonymous helpers blocks.