Actions
Feature #17724
closedMake the pin operator support instance/class/global variables
Feature #17724:
Make the pin operator support instance/class/global variables
Description
When I use pattern match with instance variables, I get an error message like "expecting local variable or method"
@n = 1
case 1
in ^@n
# ...
end
#=> syntax error, unexpected instance variable, expecting local variable or method (SyntaxError)
# in ^@n
# ^~
However using method is not allowed, either.
def n = 1
case 1
in ^n
# ...
end
#=> n: no such local variable (SyntaxError)
I think the message "expecting local variable or method" is confusing and should be fixed like "expecting local variable."
Actions