Skip to content

Commit

Permalink
Remove const_get from StringIdentifierArgument target
Browse files Browse the repository at this point in the history
[Fix rubocop#425]
`const_get` doesn't accept symbols that are something like
`:"Foo::Bar"`, and that's intended according to this issue.
https://bugs.ruby-lang.org/issues/12319
Therefore, changing String to Symbol might not work as expected.
As far as I know that's related to `const_get` only so we can remove
it from the target of `StringIdentifierArgument`
  • Loading branch information
okuramasafumi committed Dec 21, 2023
1 parent a5d918a commit 97a995a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rubocop/cop/performance/string_identifier_argument.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class StringIdentifierArgument < Base
# And `attr` may not be used because `Style/Attr` registers an offense.
# https://github.com/rubocop/rubocop-performance/issues/278
RESTRICT_ON_SEND = (%i[
class_variable_defined? const_defined? const_get const_set const_source_location
class_variable_defined? const_defined? const_set const_source_location
define_method instance_method method_defined? private_class_method? private_method_defined?
protected_method_defined? public_class_method public_instance_method public_method_defined?
remove_class_variable remove_method undef_method class_variable_get class_variable_set
Expand Down

0 comments on commit 97a995a

Please sign in to comment.