File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -4249,10 +4249,7 @@ method_call : fcall paren_args
4249
4249
| primary_value ' [' opt_call_args rbracket
4250
4250
{
4251
4251
/* %%%*/
4252
- if ($1 && nd_type_p($1 , NODE_SELF))
4253
- $$ = NEW_FCALL(tAREF, $3 , &@$ );
4254
- else
4255
- $$ = NEW_CALL($1 , tAREF, $3 , &@$ );
4252
+ $$ = NEW_CALL($1 , tAREF, $3 , &@$ );
4256
4253
fixpos ($$, $1 );
4257
4254
/* % %*/
4258
4255
/* % ripper: aref!($1, escape_Qundef($3)) %*/
Original file line number Diff line number Diff line change @@ -771,6 +771,14 @@ def test_visibility
771
771
assert_raise ( NoMethodError ) { ( self ) . mv2 }
772
772
assert_nothing_raised { self . mv3 }
773
773
774
+ class << ( obj = Object . new )
775
+ private def []( x ) x end
776
+ def mv1 ( x ) self [ x ] end
777
+ def mv2 ( x ) ( self ) [ x ] end
778
+ end
779
+ assert_nothing_raised { obj . mv1 ( 0 ) }
780
+ assert_raise ( NoMethodError ) { obj . mv2 ( 0 ) }
781
+
774
782
v = Visibility . new
775
783
776
784
assert_equal ( 'method' , defined? ( v . mv1 ) )
You can’t perform that action at this time.
0 commit comments