Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make
Node#numeric_type?
aware of rational and complex literals
This PR makes `Node#numeric_type?` aware of complex and rational literals. These literals could be treated as numeric. ```ruby 42r.is_a?(Numeric) # => true 42i.is_a?(Numeric) # => true 42ri.is_a?(Numeric) # => true ```
- Loading branch information
Showing
3 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
changelog/new_make_numeric_type_predicate_aware_of_rational_and_complex.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* [#213](https://github.com/rubocop/rubocop-ast/pull/213): Make `Node#numeric_type?` aware of rational and complex literals. ([@koic][]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters