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
A better error message for invalid signatures, when using only sorbet-runtime #3328
Comments
Given this is a runtime-only issue (static analysis produces a much more helpful error) we can probably classify it as a low priority? I'm happy to make a PR if you can give me a hint of where in |
To be clear, this is only an issue with # issue3328.rb
# typed: true
require 'sorbet-runtime'
module M
extend T::Sig
sig { params(Integer).void }
def self.f(i)
end
end
M.f(13)
Static analysis, by comparison, has a helpful error message:
|
* sorbet-runtime: Better error for params misuse Fixes #3328 * Add another test
Problem
The following signature is invalid, but it's easy to see how someone could make this mistake.
The correct signature, of course, is
params(i: Integer)
.The error message produced by
sorbet-runtime
is quite poor:Proposed solution
The error message should instead say something like: "Invalid signature: params expects a Hash"
The text was updated successfully, but these errors were encountered: