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
.is_a?
This came up in the Discord and was surprised this even works:
require "http/status" pp HTTP::Status::OK.is_a? HTTP::Status::OK # => true pp HTTP::Status::NOT_FOUND.is_a? HTTP::Status::OK # => false
Or more simply:
NUM = 1 pp NUM.is_a? NUM # => true
Is this expected?
The text was updated successfully, but these errors were encountered:
Seems odd. I suppose it behaves similar to #==?
#==
Sorry, something went wrong.
Duplicate of #11371?
Apparently the compiler relies on this behavior during expansion of case expressions, and A.is_a?(B) becomes B === A.
A.is_a?(B)
B === A
No branches or pull requests
Bug Report
This came up in the Discord and was surprised this even works:
Or more simply:
Is this expected?
The text was updated successfully, but these errors were encountered: