We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
sig/test.rbs
class X def foo: (?String) -> void end
test.rb
class X def foo(x = 1) p x end end X.new.foo('x')
These code doesn't show error. I think default value 1 is error, because X#foo is explicitly typed.
1
X#foo
My version is: ruby 3.0.2p107 steep 0.47.0
The text was updated successfully, but these errors were encountered:
The original behavior was intentional. The x has a type of Integer | String and use of the variable inside the method will report an error.
x
Integer | String
The PR changes it to a type error to make things more explicit.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
sig/test.rbs
test.rb
These code doesn't show error.
I think default value
1
is error, becauseX#foo
is explicitly typed.My version is:
ruby 3.0.2p107
steep 0.47.0
The text was updated successfully, but these errors were encountered: