[ruby-core:104608] [Ruby master Feature#17724] Make the pin operator support instance/class/global variables
From:
matz@...
Date:
2021-07-15 05:42:19 UTC
List:
ruby-core #104608
Issue #17724 has been updated by matz (Yukihiro Matsumoto). Sounds reasonable. Accepted. Matz. ---------------------------------------- Feature #17724: Make the pin operator support instance/class/global variables https://bugs.ruby-lang.org/issues/17724#change-92895 * Author: jnchito (Junichi Ito) * Status: Assigned * Priority: Normal * Assignee: ktsj (Kazuki Tsujimoto) ---------------------------------------- When I use pattern match with instance variables, I get an error message like "expecting local variable or method" ``` ruby @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. ``` ruby 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." -- https://bugs.ruby-lang.org/ Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>